PG::UndefinedTable: ERROR: relation "products" does not exist LINE 5: WHERE a.attrelid = '"products"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"products"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum PG::UndefinedTable: ERROR: relation "products" does not exist LINE 5: WHERE a.attrelid = '"products"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"products"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (406.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (1942.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (6.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (2.4ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (19.4ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (15.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (265.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (23.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (263.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (105.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (266.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (266.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (365.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (266.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (510.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (363.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (5.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" PG::UndefinedTable: ERROR: relation "" does not exist LINE 5: WHERE a.attrelid = '""'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '""'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum Product Load (1.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1 PG::UndefinedTable: ERROR: relation "" does not exist LINE 5: WHERE a.attrelid = '""'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '""'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum PG::UndefinedTable: ERROR: relation "" does not exist LINE 5: WHERE a.attrelid = '""'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '""'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" PG::UndefinedTable: ERROR: relation "" does not exist LINE 5: WHERE a.attrelid = '""'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '""'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) BEGIN Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK Category Load (0.4ms) SELECT "categories".* FROM "categories" Product Load (0.9ms) SELECT "products".* FROM "products"  (208.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (1921.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (107.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (71.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (5.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.2ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (10.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (1.0ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (333.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (4399.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (100.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (656.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (27.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (24.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (152.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (142.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Load (43.3ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (105.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (286.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (7.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (3.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (106.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (281.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (106.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (284.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.1ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (30.1ms) SELECT COUNT(*) FROM "categories" LEFT OUTER JOIN "categories" AS parent ON "categories"."parent_id" = parent.id WHERE ("categories"."lft" IS NULL OR "categories"."rgt" IS NULL OR "categories"."lft" >= "categories"."rgt" OR ("categories"."parent_id" IS NOT NULL AND ("categories"."lft" <= parent."lft" OR "categories"."rgt" >= parent."rgt"))) Category Load (0.6ms) SELECT "categories"."lft", COUNT("categories"."lft") FROM "categories" GROUP BY "categories"."lft" HAVING COUNT("categories"."lft") > 1 ORDER BY "categories"."id" ASC LIMIT 1 PG::GroupingError: ERROR: column "categories.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...t" HAVING COUNT("categories"."lft") > 1 ORDER BY "categorie... ^ : SELECT "categories"."lft", COUNT("categories"."lft") FROM "categories" GROUP BY "categories"."lft" HAVING COUNT("categories"."lft") > 1 ORDER BY "categories"."id" ASC LIMIT 1  (106.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (456.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (83.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Category Load (45.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" ASC LIMIT 1  (0.2ms) BEGIN Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE PG::SyntaxError: ERROR: zero-length delimited identifier at or near """" LINE 1: ...LECT "categories".* FROM "categories" ORDER BY ""."rgt" d... ^ : SELECT "categories".* FROM "categories" ORDER BY ""."rgt" desc LIMIT 1 FOR UPDATE  (0.1ms) ROLLBACK  (0.1ms) BEGIN Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 FOR UPDATE SQL (83.2ms) INSERT INTO "categories" ("created_at", "lft", "rgt", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", Mon, 28 Jul 2014 08:53:48 UTC +00:00], ["lft", 1], ["rgt", 2], ["updated_at", Mon, 28 Jul 2014 08:53:48 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (12.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.7ms) COMMIT  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (295.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (263.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 FOR UPDATE SQL (15.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 28 Jul 2014 08:55:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["updated_at", Mon, 28 Jul 2014 08:55:11 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1 PG::UndefinedTable: ERROR: relation "" does not exist LINE 5: WHERE a.attrelid = '""'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '""'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (106.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (257.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (105.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (266.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (200.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (1929.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.1ms) BEGIN  (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (0.6ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.1ms) BEGIN  (3.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float) SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (0.8ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (244.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (1928.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (21.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.9ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (186.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (3387.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (4.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (107.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (3.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer, "active" boolean DEFAULT 't', "name" character varying(255), "slug" character varying(255), "image" character varying(255), "description" text, "price" float, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.2ms) BEGIN  (2.4ms) DROP TABLE "shopping_cart_items"  (0.8ms) DROP TABLE "shopping_carts" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140729041407'  (1.3ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.4ms) DROP INDEX "index_products_on_category_id"  (0.4ms) DROP INDEX "index_products_on_slug"  (0.9ms) DROP TABLE "products" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140728071046'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.2ms) BEGIN  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (1.2ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (3.1ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (0.8ms) COMMIT Migrating to CreateCart (20140729041407)  (0.3ms) BEGIN  (4.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (6.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (0.6ms) COMMIT ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.1ms) BEGIN  (1.6ms) DROP TABLE "shopping_cart_items"  (1.0ms) DROP TABLE "shopping_carts" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140729041407'  (1.0ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.3ms) DROP INDEX "index_products_on_category_id"  (0.2ms) DROP INDEX "index_products_on_slug"  (0.9ms) DROP TABLE "products" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140728071046'  (1.0ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.2ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (1.1ms) DROP TABLE "categories" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140723131458'  (0.7ms) COMMIT ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.2ms) BEGIN  (6.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" ("rgt")  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" ("parent_id") SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140723131458"]]  (0.9ms) COMMIT Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (6.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (13.4ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (1.8ms) COMMIT Migrating to CreateCart (20140729041407)  (0.4ms) BEGIN  (4.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (4.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float) SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (2.1ms) COMMIT ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (5.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (5.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (142.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (1838.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (109.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.1ms) BEGIN  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" ("subject_id") SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140731171009"]]  (0.8ms) COMMIT ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.1ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (2.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (106.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (11.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.1ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.2ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (611.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (291.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (1963.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (14.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (117.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (19.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (182.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (5881.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (12.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (464.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (23.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (9.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image_file_name" character varying(255), "image_content_type" character varying(255), "image_file_size" integer, "image_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (173.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.4ms) BEGIN  (21.9ms) DROP INDEX "index_shop_images_on_subject_id"  (27.9ms) DROP TABLE "shop_images" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140731171009'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.2ms) BEGIN  (5.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" ("subject_id") SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140731171009"]]  (1.1ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (335.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (56.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (25.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (3.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (4.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (6.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (6.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (6.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (7.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (6.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (4.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.6ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (3.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (3.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (164.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (3689.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")  (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type") SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140804101936"]]  (0.6ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.1ms) BEGIN  (8.9ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_type"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_id"  (1.2ms) DROP TABLE "friendly_id_slugs" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140804101936'  (1.1ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.1ms) BEGIN  (0.5ms) DROP INDEX "index_shop_images_on_subject_id"  (1.3ms) DROP TABLE "shop_images" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140731171009'  (1.6ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.1ms) BEGIN  (1.2ms) DROP TABLE "shopping_cart_items"  (0.7ms) DROP TABLE "shopping_carts" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140729041407'  (1.0ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.3ms) DROP INDEX "index_products_on_category_id"  (1.0ms) DROP TABLE "products" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140728071046'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (0.5ms) DROP INDEX "index_categories_on_parent_id"  (0.2ms) DROP INDEX "index_categories_on_lft"  (0.3ms) DROP INDEX "index_categories_on_rgt"  (0.9ms) DROP TABLE "categories" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140723131458'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (4.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" ("rgt")  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" ("parent_id") SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140723131458"]]  (0.9ms) COMMIT Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.3ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (6.3ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (1.1ms) COMMIT Migrating to CreateCart (20140729041407)  (0.3ms) BEGIN  (3.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (0.6ms) COMMIT Migrating to CreateShopImage (20140731171009)  (0.2ms) BEGIN  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" ("subject_id") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140731171009"]]  (0.3ms) COMMIT Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (5.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")  (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140804101936"]]  (0.8ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (37.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.2ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.2ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (296.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (6.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (284.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (5.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.3ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.2ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.2ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (2.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.3ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (265.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.8ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (0.9ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_type"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope"  (0.2ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_id"  (1.1ms) DROP TABLE "friendly_id_slugs" SQL (0.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140804101936'  (1.4ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.2ms) BEGIN  (0.6ms) DROP INDEX "index_shop_images_on_subject_id"  (1.1ms) DROP TABLE "shop_images" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140731171009'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.2ms) BEGIN  (1.5ms) DROP TABLE "shopping_cart_items"  (0.7ms) DROP TABLE "shopping_carts" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140729041407'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.3ms) DROP INDEX "index_products_on_category_id"  (0.4ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.3ms) DROP INDEX "index_products_on_category_id"  (1.2ms) DROP TABLE "products" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140728071046'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (0.3ms) DROP INDEX "index_categories_on_parent_id"  (0.5ms) DROP INDEX "index_categories_on_lft"  (0.3ms) DROP INDEX "index_categories_on_rgt"  (1.0ms) DROP TABLE "categories" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140723131458'  (1.3ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (4.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug") PG::UndefinedTable: ERROR: relation "products" does not exist : CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCategories (20140723131458)  (0.1ms) BEGIN  (5.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" ("slug")  (1.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" ("rgt")  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" ("parent_id") SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140723131458"]]  (0.6ms) COMMIT Migrating to CreateProducts (20140728071046)  (0.2ms) BEGIN  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (7.5ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (1.3ms) COMMIT Migrating to CreateCart (20140729041407)  (0.2ms) BEGIN  (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (0.7ms) COMMIT Migrating to CreateShopImage (20140731171009)  (0.2ms) BEGIN  (3.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" ("subject_id") SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140731171009"]]  (0.6ms) COMMIT Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")  (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")  (1.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140804101936"]]  (0.7ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (338.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (208.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (2418.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (282.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.1ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (6.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (6.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (4.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) ROLLBACK  (1.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (109.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.3ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (280.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (109.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.6ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (109.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (292.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (291.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (106.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (280.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (108.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (109.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (108.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (281.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.5ms) Completed 200 OK in 277ms (Views: 276.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.5ms) Completed 200 OK in 176ms (Views: 175.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (109.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (1.0ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 196ms (Views: 195.5ms | ActiveRecord: 0.0ms)  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (1.1ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 132ms (Views: 131.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Completed 500 Internal Server Error in 172ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 135ms (Views: 134.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (505.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 144ms (Views: 143.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (9.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.1ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 134ms (Views: 133.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 166ms (Views: 165.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.2ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 137ms (Views: 136.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (283.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (3.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 133ms (Views: 132.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (282.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 134ms (Views: 133.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 161ms (Views: 160.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (297.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (4.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.1ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (4.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (9.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (3.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (3.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (3.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (10.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (3.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (5.1ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN Processing by PowerShop::CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 437ms (Views: 436.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 191ms (Views: 190.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 180ms (Views: 179.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (2.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 181ms (Views: 180.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (211.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (4611.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (17.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (132.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 04:59:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 04:59:30 UTC +00:00]] Category Load (2.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1ecb3f21-a932-4a96-8234-dc74d77cd367"], ["updated_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 04:59:31 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 418ms (Views: 417.4ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (9.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.2ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.6ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:00:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:00:09 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-010e365f-6ca3-4835-ad6c-1009dbbbddc6"], ["updated_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:00:10 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML PowerShop::Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC PG::UndefinedColumn: ERROR: column products.sort does not exist LINE 1: ...ducts" WHERE "products"."active" = 't' ORDER BY "products"... ^ : SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC PowerShop::Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block : SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (18.3ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_type"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope"  (0.3ms) DROP INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type"  (0.4ms) DROP INDEX "index_friendly_id_slugs_on_sluggable_id"  (1.2ms) DROP TABLE "friendly_id_slugs" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140804101936'  (1.0ms) COMMIT ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateShopImage (20140731171009)  (0.2ms) BEGIN  (0.5ms) DROP INDEX "index_shop_images_on_subject_id"  (0.9ms) DROP TABLE "shop_images" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140731171009'  (1.0ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateCart (20140729041407)  (0.2ms) BEGIN  (1.2ms) DROP TABLE "shopping_cart_items"  (0.7ms) DROP TABLE "shopping_carts" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140729041407'  (1.1ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (0.8ms) ALTER TABLE "categories" DROP "products_count"  (0.4ms) DROP INDEX "index_products_on_category_id"  (0.2ms) DROP INDEX "index_products_on_slug"  (1.0ms) DROP TABLE "products" SQL (0.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20140728071046'  (0.9ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateProducts (20140728071046)  (0.1ms) BEGIN  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" ("slug")  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" ("category_id")  (7.0ms) ALTER TABLE "categories" ADD COLUMN "products_count" integer DEFAULT 0 SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140728071046"]]  (2.0ms) COMMIT Migrating to CreateCart (20140729041407)  (0.2ms) BEGIN  (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140729041407"]]  (0.6ms) COMMIT Migrating to CreateShopImage (20140731171009)  (0.4ms) BEGIN  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" ("subject_id") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140731171009"]]  (0.6ms) COMMIT Migrating to CreateFriendlyIdSlugs (20140804101936)  (0.2ms) BEGIN  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")  (1.3ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")  (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140804101936"]]  (0.3ms) COMMIT ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (298.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.2ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (9.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-992c9620-8509-4ece-906b-c7fcf127f9e6"], ["updated_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:02:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-37c7cb19-77ef-4297-b60b-d72f8d4ac899"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 228ms (Views: 227.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2c5d1299-7b56-4d18-8533-c0d81ddbf428"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:05:35 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-678fb2fe-5d10-4f63-a5a0-0fdc650f4627"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 224ms (Views: 223.0ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-89c92b18-b3e0-486f-b2ea-638ccf8b716b"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:06:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (109.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b570958a-6f2b-44dc-ad3a-50d18919e1da"], ["updated_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:08:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 219ms (Views: 218.2ms | ActiveRecord: 0.0ms) PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d17ce4c3-2043-4545-96ed-3c8bfaf69452"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-80ee2c79-b158-4ad6-90c1-278649e0fb29"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e3e07267-8a9b-4602-8522-d25b21e4e6a3"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:08:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00]] Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-77b96229-e465-41f4-bbec-ea83b00626a9"], ["updated_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:09:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (1.2ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5e535a0f-3e7e-4bb7-b811-d40fc3af34ca"], ["updated_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:10:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 214ms (Views: 213.2ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5fd604d8-5b75-41a5-937a-74ed107a3499"], ["updated_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:10:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-72a43e2f-4ccf-49ec-8ec6-c11f2ee88c94"], ["updated_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:11:42 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 227ms (Views: 226.5ms | ActiveRecord: 0.0ms) PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (108.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (265.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.2ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.3ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-dead56f2-8ca9-481a-bd75-298d37650061"], ["updated_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:12:24 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC Product Load (0.4ms) SELECT "products".* FROM "products" PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' Product Load (0.3ms) SELECT "products".* FROM "products" Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't'  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5ac6c242-94fd-4c59-b9bd-6ef5e4412784"], ["updated_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:16:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (0.7ms) SELECT "products".* FROM "products" WHERE ('active') PG::InvalidTextRepresentation: ERROR: invalid input syntax for type boolean: "active" LINE 1: SELECT "products".* FROM "products" WHERE ('active') ^ : SELECT "products".* FROM "products" WHERE ('active') Product Load (0.4ms) SELECT "products".* FROM "products" WHERE ('active') PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block : SELECT "products".* FROM "products" WHERE ('active')  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (3.2ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (3.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.4ms) BEGIN  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00]] Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b24eb7ee-5a61-425f-a923-39b229955336"], ["updated_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:18:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.5ms) Completed 200 OK in 11836ms (Views: 228.4ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fe769cb5-8b36-4f83-9778-e26a6974c619"], ["updated_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:18:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0c47cdf6-10fa-4058-8b92-67210e7746e8"], ["updated_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:19:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 263ms (Views: 262.6ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3de1bbb6-f59d-4b8a-aa0e-5741489a8c9e"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a21bc664-c060-405e-b0d0-78e786bf0128"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:19:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (12.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (3.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (3.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (6.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-659e17b4-4b05-4cc7-bddb-795543b1e9fd"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 263ms (Views: 262.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9c5a00c5-845a-4f30-ad0d-1b1e1c42422a"], ["updated_at", Thu, 07 Aug 2014 05:19:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c9983846-c647-4c3a-a7f5-0145996eda46"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-70c8648c-eea9-4835-870c-cf8aca826f5c"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:19:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ca69c530-86ad-4ae1-a812-5ec9367d0bb0"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 242ms (Views: 241.5ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-023dc653-6e0b-4ba4-b599-d6eafc28d1a4"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5313db92-acf9-43c5-a93f-15ecacb3f5fb"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1c272bf1-4bb1-4688-8cd2-df5e16adce26"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:20:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (110.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (16.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (16.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (3.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.2ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (6.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (3.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.2ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3afc18d2-6109-4a54-880e-49c25f3760a2"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC Completed 500 Internal Server Error in 36ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b9064289-ff5b-4cbd-aaab-6b3d1683a415"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC Completed 500 Internal Server Error in 2ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-215cd5e4-0122-4be0-b048-df9d389dff27"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC Completed 500 Internal Server Error in 4ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2f10352d-d33a-443a-a1a5-5224ad3aebdf"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:21:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC Completed 500 Internal Server Error in 2ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (287.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.3ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:26:23 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f4c1f4c5-b9b3-4cb3-b238-e6b858200825"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 239ms (Views: 238.0ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5929c5a3-4f30-411c-aca7-f26d8a6f37a7"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."active" = 't'  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a64556d2-9925-4370-8319-76f266dc2d94"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-770595ac-be73-4f5c-be78-257caf4cb8a5"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:26:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1f9b8590-aa11-4d30-a7ff-69bc638d7026"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 220ms (Views: 218.8ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b5e1a743-6d6e-462b-9160-e0f74c003ac9"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7f3a473d-2ece-4925-8b02-e0dfff8eb94d"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d6a7aad4-ef45-492a-8602-f277370446e2"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:27:01 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a68611ca-c0c5-4aef-8200-2514aced5c86"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 189ms (Views: 188.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6c70edc2-fad4-4e8c-8989-8a9c9eb234b0"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (2.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c0fed8d7-04ec-4024-abda-043fddb8d7f4"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:27:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-aef80107-d069-4c3b-8da3-61a7f5d50c24"], ["updated_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:27:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-146600aa-bd98-4daa-b87e-8a582cf46728"], ["updated_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 07 Aug 2014 05:28:48 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 182ms (Views: 181.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0d74ecbb-bf76-4a72-9f44-4b85f808e339"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0439673a-f6a0-484c-ae50-ad4e06850b45"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a7d52ba2-72fe-40b1-8af4-ec5c2947b1e1"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7eaf3b38-6877-4ef0-bd25-9a1077da5e8a"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 07 Aug 2014 05:28:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (199.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (1953.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (19.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (46.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 07:59:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 07:59:37 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 07:59:37 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 07:59:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.1ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3d89215e-4e27-43b3-9799-72aa7af507e4"], ["updated_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 08:00:18 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 327ms (Views: 272.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3db27a0e-5920-4d8d-930d-8a9d8373b6e1"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-97ecc53a-c5d0-4a30-9048-5d9ddf6967eb"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e85c7c70-a65f-4309-a12c-9f10392d11db"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6becab03-a313-4e03-bbd9-95a5feba49aa"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 08:00:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:00:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:00:38 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 08:00:38 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 08:00:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "categories" WHERE "categories"."id" = 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (112.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b4794a79-3943-4144-b4a8-ad6d7a61b0ec"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 184ms (Views: 183.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6cfb8de7-b77f-481e-96da-f9ba613480ab"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-77793c06-9241-462e-9d17-023df8d8fe57"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a93ba85c-2f78-4094-aa9a-fa05218d1ab1"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-86ffc9d3-5d27-44ad-8486-3692df75c240"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 08:01:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 11], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 11]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 11]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e609243d-39a9-47c3-b749-bc29bff903cf"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 183ms (Views: 182.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-203ddb89-eeab-4858-b571-45ae6c8a27b8"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1081ec36-662f-4db7-9c2a-5b55f1705637"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ec91af03-6abe-44f9-91ad-4edc76ba9668"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b3ad9b89-011d-4ba2-80df-14da5d8271b8"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 08:02:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:02:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:02:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 08:02:45 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 08:02:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.2ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 11], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 11]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.2ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.3ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.1ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (1.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.7ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5ab369c6-bf3d-45da-8c9e-12a0512355e4"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 233ms (Views: 231.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-316eccc2-5689-4273-8d36-8aa25d3eaf37"], ["updated_at", Sun, 10 Aug 2014 08:04:36 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8b0a56b2-32fe-4616-bf58-2f677b4a0870"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-976b8467-5b53-4871-99cd-86717d47b567"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-df200118-5d2c-43e8-9322-26116a9355bb"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 08:04:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.3ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (4.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (1.0ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-dd963bbb-fb24-442e-a3b5-f5b2da0e29df"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 185ms (Views: 183.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f6140aa4-bdb8-49e4-8c37-81dc88463844"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0c337a44-17c6-4641-9202-bfc64776c296"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 08:05:53 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5e292dca-1630-471f-9df0-b55b5f225fce"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-abd8fc2c-b070-4fa5-a9b7-9410d3da9809"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 08:05:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (264.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-44c075b8-abec-44b0-9abf-de81a6568ac4"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 173ms (Views: 172.3ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7004072e-1bc1-43c3-98eb-94f02867873a"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a44bee16-4dfa-4b56-b76a-67b5eda92666"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:12:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f3bca156-c737-450e-a300-e198c3c84474"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b74b52fc-983d-444b-89bf-d304f2524466"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 47ms (Views: 45.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-be2b0380-7dbe-40ef-b860-15604d3ab484"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:12:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (109.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (285.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:05 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7dceef3d-5924-4f9f-a1d2-05358a2c868c"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 179ms (Views: 178.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-150ae59f-9227-4d6d-ac18-1e983d5e95d2"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3d2226d7-2211-43f3-b43a-799e0e583fc9"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8a714adb-d4f0-4a03-80dc-90fba07e0acf"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-75a27fd2-81b4-45fd-a18a-da218f4bae79"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 45ms (Views: 43.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6b579288-3ba8-4378-bd2c-87fb87a8f891"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:13:06 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (9.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.2ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (57.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:39 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.1ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 500 Internal Server Error in 170ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-82d654f0-bab5-413b-862f-eede5fd6ec33"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 145ms (Views: 143.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2349d77c-ed4c-456b-91b1-c4c84fb29387"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.6ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c7094599-ac32-4e2d-9769-1f0aae22ad62"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-38a1e72e-c086-42f7-a51c-d78ce62717d1"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fa2f9fa1-94fb-4757-9ce0-ba11de03bbfa"], ["updated_at", Sun, 10 Aug 2014 10:15:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-60d8f29a-ea21-4952-b671-5d7effb872ab"], ["updated_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:15:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (23.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (1.1ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-11a76c32-6874-49a3-ad89-4fd4ebd457bf"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 187ms (Views: 185.7ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5a1f86ab-13fb-476d-b800-daa4f4a8f52b"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b4d5e2c1-dde1-493c-926e-bb6e850749f5"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1ea382c0-9343-4c6b-814f-1fc164ba3b43"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a3da68b8-0640-4de4-9fe5-f5a3a286c264"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:16:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 57ms (Views: 56.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-27f2eeae-3e3f-47ee-a0dd-55c62fd8ef02"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 186ms (Views: 185.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6f94c60d-a75f-47ac-9cfe-c7a7313dd4f9"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-13139b21-3491-45a2-8103-edf405f38394"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e9192063-a0bd-4691-ac26-f0a732d3e683"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 9]] SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-eb929846-17dc-42f8-b62d-c298185b0bc3"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-79745677-83fc-4f2a-8bfc-e8c5689d8daf"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00], ["lft", 5], ["name", "Test category"], ["rgt", 6], ["slug", "test-category-fcc3aa24-fe7e-4e02-9ce2-c554df73dc94"], ["updated_at", Sun, 10 Aug 2014 10:17:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category-fcc3aa24-fe7e-4e02-9ce2-c554df73dc94"} Completed 200 OK in 58ms (Views: 57.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 10 Aug 2014 10:17:11 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:17:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 14) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 13], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 13]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 14], ["subject_type", "Category"]] SQL (1.0ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 14]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (7.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 185ms (Views: 183.4ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:17:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 51ms (Views: 51.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:17:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:17:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:17:43 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:17:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.2ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 13], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 13]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 185ms (Views: 183.6ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:26 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 52ms (Views: 51.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 10 Aug 2014 10:18:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 10) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 19], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 19]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 10], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 10]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 180ms (Views: 178.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:21:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 500 Internal Server Error in 0ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 500 Internal Server Error in 0ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 500 Internal Server Error in 0ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 500 Internal Server Error in 0ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 10 Aug 2014 10:21:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 10) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.0ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 19], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 19]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 10], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 10]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 10]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.9ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 404 Not Found in 1ms  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 404 Not Found in 1ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 404 Not Found in 1ms  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"slug"=>"test-category"} Completed 404 Not Found in 1ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 210ms (Views: 208.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 10 Aug 2014 10:22:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 10 Aug 2014 10:22:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:46 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:22:46 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:22:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 178ms (Views: 176.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:22:47 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (2.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (4.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (57.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (6.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (4.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (5.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 [1mCategory Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (6.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (4.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (48.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (6.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (5.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (2.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (6.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (55.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (3.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (6.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (84.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:24:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 184ms (Views: 182.5ms | ActiveRecord: 0.0ms)  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (281.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00]] Category Load (34.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:25:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:20 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (1.2ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.6ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] PowerShop::Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "PowerShop::Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.5ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 195ms (Views: 185.5ms | ActiveRecord: 1.2ms) PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 4]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count [["category_id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.2ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 58ms (Views: 57.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 10 Aug 2014 10:27:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:17 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 10 Aug 2014 10:34:17 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 10 Aug 2014 10:34:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.9ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 190ms (Views: 185.6ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.6ms | ActiveRecord: 0.6ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count [["category_id", 3]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.7ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.7ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.7ms | ActiveRecord: 0.5ms) Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 57ms (Views: 56.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 10 Aug 2014 10:34:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (264.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (1945.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (58.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (22.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (45.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (13.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (1.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00]] SQL (2.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 17 Aug 2014 08:38:08 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 301ms (Views: 300.1ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (2.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (2.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 59.7ms | ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (3.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (1.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 17 Aug 2014 08:38:09 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.4ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 14ms (Views: 2.1ms | ActiveRecord: 0.7ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count [["category_id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 17 Aug 2014 08:38:10 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.6ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.3ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 AND "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 [["category_id", 11]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (462.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (2095.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (108.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (56.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (3.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:15:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 266ms (Views: 264.7ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (4)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 58ms (Views: 53.7ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (1.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:15:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.8ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (207.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (331.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:27:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (1.2ms) Completed 200 OK in 199ms (Views: 192.5ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 2.8ms | ActiveRecord: 1.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 66ms (Views: 65.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:27:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (6.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 183ms (Views: 181.9ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:28:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 62ms (Views: 54.7ms | ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.7ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.5ms | ActiveRecord: 0.8ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:28:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.2ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 12) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 12]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 12 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 12], ["subject_type", "Category"]] SQL (0.6ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 12]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (106.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 189ms (Views: 180.8ms | ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 2.6ms | ActiveRecord: 0.7ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:30:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 57ms (Views: 55.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (1.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:30:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 181ms (Views: 180.1ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:31:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 56.0ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 0.9ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:31:01 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.9ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.3ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (19.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:23 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (2.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:31:23 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:31:23 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:31:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:31:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:31:30 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:31:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (283.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:07 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:32:07 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:32:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:32:12 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:32:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 186ms (Views: 181.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 2.8ms | ActiveRecord: 0.8ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (1.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.6ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 58ms (Views: 57.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:32:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:32:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:32:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 198ms (Views: 196.7ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) Product Load (1.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 55ms (Views: 50.6ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.3ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.2ms | ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:33:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (296.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:21 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:33:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:33:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Product Load (0.5ms) SELECT "products".* FROM "products"  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:33:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:33:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:33:29 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:33:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Product Load (0.4ms) SELECT "products".* FROM "products" Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (707.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:07 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:34:07 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:34:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 2) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 2], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.5ms) Completed 200 OK in 275ms (Views: 270.4ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.0ms | ActiveRecord: 0.8ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:34:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.9ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 75ms (Views: 73.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:34:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:34:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 207ms (Views: 206.2ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 63ms (Views: 58.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.6ms | ActiveRecord: 0.7ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:34:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:03 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 2) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 2], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 214ms (Views: 213.3ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 54.6ms | ActiveRecord: 0.8ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:37:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:37:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (296.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (1.0ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (1.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (43.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 292ms (Views: 290.9ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 106ms (Views: 101.3ms | ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:37:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 1.2ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (2.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 241ms (Views: 239.9ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.7ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 56.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 11ms (Views: 2.8ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (2.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:38:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (1.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (109.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:38:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 276ms (Views: 274.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 61ms (Views: 55.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 3.0ms | ActiveRecord: 0.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:38:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.3ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 2) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]] ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 2], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:39:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 226ms (Views: 221.5ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 111ms (Views: 109.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:39:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (208.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (23.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 190ms (Views: 188.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 73ms (Views: 68.4ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.4ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.8ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:39:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:40:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:40:09 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:40:09 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:40:09 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 12]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (265.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (12.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (3.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (2.0ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:41:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 201ms (Views: 195.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 2.5ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 56ms (Views: 55.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:41:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 12]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 12) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 12]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 12], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 12]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 12]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (2.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:43 UTC +00:00]] Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.5ms) Completed 200 OK in 201ms (Views: 200.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 61ms (Views: 54.1ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.3ms | ActiveRecord: 1.3ms) Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.0ms | ActiveRecord: 0.6ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (1.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:41:45 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:45 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:42:45 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:42:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (1.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.5ms) Completed 200 OK in 204ms (Views: 200.1ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.4ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 63ms (Views: 62.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:42:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (106.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (24.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 2) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 2], ["subject_type", "Category"]] SQL (0.2ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:43:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 763ms (Views: 761.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 57ms (Views: 53.2ms | ActiveRecord: 0.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.4ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.2ms | ActiveRecord: 0.9ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:43:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (209.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (288.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:44:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 197ms (Views: 195.5ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 64ms (Views: 60.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.6ms | ActiveRecord: 0.6ms)  (1.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 183ms (Views: 181.7ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 55ms (Views: 51.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.7ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:45:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:45:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:45:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:45:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:45:22 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:45:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 12 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (284.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.3ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (3.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (1.0ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (24.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 178ms (Views: 173.3ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:47:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 56ms (Views: 55.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:47:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (270.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:48:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 180ms (Views: 175.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.0ms | ActiveRecord: 1.3ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.7ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.6ms | ActiveRecord: 0.5ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 61ms (Views: 59.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:48:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (118.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 177ms (Views: 174.8ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 56ms (Views: 50.8ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 12 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:48:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 13]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 13) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 13]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 13], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 13]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 13]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.4ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 180ms (Views: 179.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 59ms (Views: 54.8ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:50:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:50:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:22 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:50:22 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:50:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.3ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:50:23 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:50:23 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Fri, 22 Aug 2014 13:50:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 185ms (Views: 183.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 64.4ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 2.8ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 13:50:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (285.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Fri, 22 Aug 2014 13:51:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:52:21 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.5ms) Completed 200 OK in 450ms (Views: 449.3ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 61ms (Views: 57.4ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 2.7ms | ActiveRecord: 0.8ms) Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14 SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 13:52:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:54:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:54:12 UTC +00:00]] Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:54:12 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:54:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:55:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 391ms (Views: 389.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 55.7ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.1ms | ActiveRecord: 0.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:55:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 23 [["active", false], ["updated_at", Fri, 22 Aug 2014 13:55:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:55:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:55:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:55:40 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 13:55:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 14 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 14 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 24], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 24]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (265.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.2ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 13:59:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 13:59:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.2ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 13:59:01 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 13:59:01 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Fri, 22 Aug 2014 13:59:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 13:59:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (1.0ms) Completed 200 OK in 184ms (Views: 179.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.0ms | ActiveRecord: 1.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.9ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 122ms (Views: 121.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12 SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 13:59:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.3ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Fri, 22 Aug 2014 14:04:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (2.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 193ms (Views: 186.7ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 14:04:16 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 53ms (Views: 52.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 14:04:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (110.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (22.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:22 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:05:22 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 14:05:22 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Fri, 22 Aug 2014 14:05:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 4) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.7ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 193ms (Views: 185.6ms | ActiveRecord: 1.7ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.5ms | ActiveRecord: 0.5ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.3ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 58ms (Views: 57.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 14:05:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (107.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 214ms (Views: 211.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 58ms (Views: 54.1ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.4ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 14:06:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 23 [["active", false], ["updated_at", Fri, 22 Aug 2014 14:06:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:06:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:06:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:06:44 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 14:06:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 14  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (108.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Fri, 22 Aug 2014 14:07:37 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 248ms (Views: 243.4ms | ActiveRecord: 0.4ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.9ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.2ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 66ms (Views: 65.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.3ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.9ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 24 [["active", false], ["updated_at", Fri, 22 Aug 2014 14:07:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (200.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (1917.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (4.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (48.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:07:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:07:48 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:07:48 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:07:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (1.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.2ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.2ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:09:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:09:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:09:52 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:09:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:09:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:09:58 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:09:58 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:09:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:10:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:10:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:10:02 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:10:02 UTC +00:00]]  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.2ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:10:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:10:55 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:10:55 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:11:13 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:11:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 243ms (Views: 242.1ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:11:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:11:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:11:26 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:11:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:11:31 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:11:31 UTC +00:00]]  (107.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.4ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 216ms (Views: 212.3ms | ActiveRecord: 0.4ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:13:00 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 73ms (Views: 71.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:13:01 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (109.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (1.2ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.2ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.3ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 4) SQL (0.7ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.0ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 4], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 4]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.7ms) Completed 200 OK in 217ms (Views: 212.8ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.4ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.7ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.0ms | ActiveRecord: 1.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 89ms (Views: 87.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:14:27 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:14:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.5ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:15:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 248ms (Views: 243.9ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 3.1ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.6ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.8ms | ActiveRecord: 0.6ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 70ms (Views: 69.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:15:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:17:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 475ms (Views: 470.6ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 70ms (Views: 69.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.9ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:17:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (106.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:06 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:19:06 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:19:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 375ms (Views: 370.8ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.6ms | ActiveRecord: 1.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.3ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 67ms (Views: 66.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:19:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 5]]  (0.1ms) SAVEPOINT active_record_1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 5) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 5]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 5], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:21:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 252ms (Views: 247.5ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 72ms (Views: 70.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (1.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (1.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:21:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (314.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (8.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:21:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:21:44 UTC +00:00]] Category Load (2.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:21:45 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:21:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (2.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 4]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 4) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 4], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 4]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:22:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.5ms) Completed 200 OK in 767ms (Views: 760.0ms | ActiveRecord: 1.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.6ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.7ms)  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:22:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 543ms (Views: 541.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:22:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (286.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (3.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (3.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.1ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 211ms (Views: 207.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:24:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.7ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 72ms (Views: 71.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:24:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:25:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 553ms (Views: 548.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.6ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 74ms (Views: 73.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:25:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.3ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (6.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 272ms (Views: 270.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 58ms (Views: 54.5ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:26:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 14) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]] ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 24], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 24]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 14 SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 14 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 14], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 14]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 14]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (586.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.1ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 187ms (Views: 182.4ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 0.9ms | ActiveRecord: 0.3ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.1ms | ActiveRecord: 0.5ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:27:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 55ms (Views: 54.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:27:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 208ms (Views: 206.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:29:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (1.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 59ms (Views: 54.5ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.7ms | ActiveRecord: 0.8ms)  (1.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 11) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 21], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 21]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 11 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 11], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 11]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:29:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 25], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.2ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.6ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:29:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 203ms (Views: 199.1ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 59ms (Views: 58.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:29:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.4ms) DROP DATABASE IF EXISTS "power_shop_test"  (276.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (2.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:30:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 185ms (Views: 181.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:32:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 67ms (Views: 61.8ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 0.9ms | ActiveRecord: 0.6ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (4.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 22 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 25], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sat, 23 Aug 2014 18:32:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 16]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 16) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.6ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 26], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 26]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 16 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 16 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 16], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 16]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:33:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:33:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.6ms) Completed 200 OK in 194ms (Views: 189.8ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 57ms (Views: 56.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sat, 23 Aug 2014 18:33:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:35:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:35:18 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:35:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:35:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:35:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:35:25 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:35:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:35:25 UTC +00:00]]  (107.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:37:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 189ms (Views: 187.7ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 62ms (Views: 58.0ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.9ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:37:31 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 22 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 23], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 23]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 25], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sat, 23 Aug 2014 18:37:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]]  (0.3ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 16]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 16) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 26], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 26]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 16 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 16 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 16], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 16]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (2.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.3ms) Completed 200 OK in 194ms (Views: 186.2ms | ActiveRecord: 1.1ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.7ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.9ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 55ms (Views: 54.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sat, 23 Aug 2014 18:38:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 22], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 22]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 23 [["active", true], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (41.3ms) SAVEPOINT active_record_1 Product Exists (3.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 25], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 25]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 26 [["active", false], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 16  (0.3ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sat, 23 Aug 2014 18:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (1.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 17) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 27], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 27]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 17], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (238.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (4671.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (287.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (19.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.1ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (9.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (7.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (3.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (3.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.2ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (6.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (5.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (6.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (70.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:13 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:50:13 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:50:13 UTC +00:00]] SQL (13.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (1.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (1.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (1.9ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (9.6ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (2.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2e0c7eea-2839-481c-81fa-236db47e4eca"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:50:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-8"} Product Load (1.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-8' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Completed 500 Internal Server Error in 444ms  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (4.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 255ms (Views: 249.2ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.3ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.7ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14)  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (2.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (4.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 14ms (Views: 2.2ms | ActiveRecord: 4.7ms)  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (2.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 98ms (Views: 97.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:15 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (4.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (24)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 10ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (8.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:50:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (398.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (41.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (133.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (6.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (7.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (4.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (5.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (6.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (5.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (15.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (3.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (8.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (9.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (3.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (184.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:20 UTC +00:00]] Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 1 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (2.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (1.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.2ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.2ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e96a8fb9-f50b-4d8e-9044-e193e6d0be44"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-8"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-8' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Rendered /vagrant/power_shop/app/views/power_shop/catalog/product.html.erb within layouts/application (0.3ms) Completed 200 OK in 752ms (Views: 668.2ms | ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (6.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:51:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 98ms (Views: 84.4ms | ActiveRecord: 0.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 LIMIT 25 OFFSET 0) subquery_for_count  (5.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.4ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 13ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (1.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (5.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 109ms (Views: 107.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (6.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:51:23 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (10.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:51:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 9ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (4.9ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (263.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (1532.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (471.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (11.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (8.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (15.3ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (42.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (14.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (20.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (30.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (16.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (33.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (51.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (4.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (80.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (8.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (129.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (20.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (26.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (56.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (10.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (6.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (12.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (6.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (24.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (7.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (79.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.4ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 6 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:52:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 277ms (Views: 272.8ms | ActiveRecord: 0.6ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.7ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (2.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3fc8e7ad-b698-4221-9782-17d686e8676c"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-20"} Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-20' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 Completed 404 Not Found in 5ms  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (2.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1da08672-e0cb-4dc9-b1f2-6232606fb5ef"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:52:47 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Completed 200 OK in 60ms (Views: 55.0ms | ActiveRecord: 0.8ms)  (1.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 92ms (Views: 91.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (4.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30)  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:52:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.5ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:53:27 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.2ms) SAVEPOINT active_record_1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.8ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.5ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 211ms (Views: 207.0ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 1.4ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-509301a7-6243-4630-b260-9366905fcb95"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-20"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-20' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 Completed 404 Not Found in 3ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (3.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f184f2d5-a145-469a-b315-716c9712e7c1"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Completed 200 OK in 65ms (Views: 59.2ms | ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 74ms (Views: 72.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:53:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (1.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:53:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 193ms (Views: 191.1ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 62ms (Views: 56.5ms | ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.3ms | ActiveRecord: 0.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:54:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9217d13f-8543-4d93-881f-e2f6c2935d60"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fbf8e34d-4800-45cc-8a52-76c30c7ed6cc"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Completed 200 OK in 65ms (Views: 58.2ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 28], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 28]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 29 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (1.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 31], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 31]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 32 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:54:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 21]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 21]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 21) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 21]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 21], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 21]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:31 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 200ms (Views: 192.1ms | ActiveRecord: 1.7ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 65ms (Views: 63.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:55:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8c716741-e4cb-4762-a045-3c4fbdf3c8e5"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9760b62b-de07-4263-a3eb-17b4d810e1d9"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Completed 200 OK in 65ms (Views: 58.0ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c3245528-508c-4ed0-b645-10fcdfff9b0c"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Completed 200 OK in 6ms (Views: 0.9ms | ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (1.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 17) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 30], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 30]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 17], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 31], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 31]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 33 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 36 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:55:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] SQL (1.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b051dd4f-6b37-410e-910c-d2d397716215"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-68a0e397-fcec-4c42-acfe-aa2d87681b1e"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Completed 200 OK in 311ms (Views: 267.2ms | ActiveRecord: 0.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a42db95b-1af8-48ed-8dda-d90c848eaad7"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Completed 200 OK in 6ms (Views: 0.6ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 68ms (Views: 63.5ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.7ms | ActiveRecord: 0.5ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.4ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 77ms (Views: 75.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (1.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (3.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 06:57:19 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.3ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.4ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (6.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (4.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 200ms (Views: 199.1ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (1.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d797515c-9dac-4b84-bc58-68b86195efc0"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Completed 200 OK in 65ms (Views: 60.5ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-01d930b0-f213-4359-a826-d6a99ea2f923"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Completed 200 OK in 5ms (Views: 0.8ms | ActiveRecord: 0.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-97a44fd6-585a-44ed-94c9-5200ef927c90"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 63ms (Views: 59.2ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (2.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 17) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 30], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 30]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 17], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 32 [["active", false], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", true], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 06:58:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 36], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 36]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (330.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (1328.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (27.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (213.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (49.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:44 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (26.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3e5c9621-fd71-4dac-8636-1d1b3ef7df6b"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d7b72185-e973-406a-8af3-2d0115093243"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13"} Completed 404 Not Found in 1ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-eded3c46-11db-41d5-a067-a8d2dee702e8"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16"} Completed 404 Not Found in 0ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 244ms (Views: 240.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 0.7ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 15 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 07:45:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.4ms) Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 72ms (Views: 71.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (31) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 07:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.3ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.5ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ca712bfd-e442-46db-8af4-c8dbf9080d09"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c460d956-39d0-42ac-85b4-8ee90ba24782"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-6", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-6' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (6) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4) Completed 200 OK in 307ms (Views: 220.8ms | ActiveRecord: 2.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a6677044-2cdc-41d3-a666-95335ebffff9"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 10ms (Views: 1.3ms | ActiveRecord: 1.6ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 59ms (Views: 57.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (10) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 07:47:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 56.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (24) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.4ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 17) SQL (0.3ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.3ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 30], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 30]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 17 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 17], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 17]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 31 [["active", false], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 18  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]]  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 34 [["active", true], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 07:47:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 36], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 36]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 196ms (Views: 193.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 07:48:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 64ms (Views: 59.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11) Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.4ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (44.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-35ed5f40-b666-44c5-a7b4-b7341940c530"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-bb5250b7-928c-42af-91c1-f2695bfb5a24"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 64ms (Views: 56.1ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-374a6143-c38e-48e6-96b2-2110bec4306a"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16) Completed 200 OK in 10ms (Views: 1.0ms | ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3597113d-79d2-4bfa-96bb-f431be994adc"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", false], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 07:48:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", true], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 07:48:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.3ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.8ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 25) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.6ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 25], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.3ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (61.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", true], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 6 [["active", false], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (1.8ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.9ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 07:51:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 293ms (Views: 291.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) Product Load (1.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 64ms (Views: 59.7ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.9ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 15 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (24) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 LIMIT 25 OFFSET 0) subquery_for_count  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 18]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-febf8dc2-f682-4e4b-b2c0-f1550f5108b6"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a50aa466-e7ae-4545-8df9-645447f078b8"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 07:51:30 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-33", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-33' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21) Completed 200 OK in 70ms (Views: 60.4ms | ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 22]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-41e57807-5208-4749-bac0-75f87937dee2"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-36", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-36' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (36) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (23) Completed 200 OK in 12ms (Views: 1.3ms | ActiveRecord: 1.9ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-24b24f6d-5248-4ee8-9b40-9318b3281a81"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 07:51:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (267.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (1936.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (14.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (84.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (6.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (28.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (12.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (4.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (17.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (80.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (58.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 241ms (Views: 234.8ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 10:53:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 54ms (Views: 47.7ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (2.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 60ms (Views: 58.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (7)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0c0475aa-15a6-4775-ac96-363330281743"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12) Completed 200 OK in 80ms (Views: 65.6ms | ActiveRecord: 2.0ms)  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 10:54:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3343a8e1-aa2b-42c0-b68f-244424da01e8"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 17ms (Views: 1.3ms | ActiveRecord: 1.9ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-80228990-dcd0-45dc-b34f-3972c15c4876"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-de41c173-5009-4b35-9062-d41c0e8992f0"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 10:54:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"}  (108.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (267.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.3ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (59.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:12:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:12:59 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:12:59 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:12:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"1"} Completed 500 Internal Server Error in 5264ms  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (1.1ms) SAVEPOINT active_record_1 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (3.0ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 7 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:13:05 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 8]]  (0.6ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 8) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.2ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 8]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 8], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 8]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 8 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 8 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 8], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 8]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 167ms (Views: 165.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (52.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 70ms (Views: 59.8ms | ActiveRecord: 1.7ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:13:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 12ms (Views: 1.2ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3d384af3-d0d7-42ae-98c5-8c28458ee826"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 21]] SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9676d316-8bfd-432a-a094-970ecbb2deb5"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-34", "category_id"=>"test-category"} Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-34' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (34) Category Load (2.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22) Completed 200 OK in 81ms (Views: 55.5ms | ActiveRecord: 4.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (3.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 23]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9375a9f7-bf78-4c99-b70b-09d1565b368b"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-37", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-37' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (37) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (24) Completed 200 OK in 17ms (Views: 2.4ms | ActiveRecord: 2.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8fc12e76-4008-4ad8-aef2-f6817307d087"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 26], ["created_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Sun, 24 Aug 2014 11:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (11.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.7ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (2.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.5ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.9ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (71.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (7.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (2.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1be2d4ef-d953-47b9-9df1-5b9158195c0a"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6662e4f3-1bb8-416c-b204-e60c8e66846f"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:14:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-6", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-6' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (6) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4) Completed 200 OK in 359ms (Views: 252.4ms | ActiveRecord: 4.2ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f78b2b4d-d7f5-4a76-800c-f346ccc850df"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 21ms (Views: 1.8ms | ActiveRecord: 2.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (2.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4ecf1176-5848-4ede-9689-8b5c286da6d4"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (3.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 73ms (Views: 62.2ms | ActiveRecord: 3.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.4ms | ActiveRecord: 0.9ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:14:17 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.8ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 91ms (Views: 89.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (2.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (2.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.6ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 8ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (7.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (2.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:14:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.9ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 34 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.5ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (6.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 35], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 35]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 37 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 38], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 38]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (3.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:14:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (129.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (390.7ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.3ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.2ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (15.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:17:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.0ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c8f40c2c-fe54-4a1b-8279-e88e0bf36e24"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9addaee8-0a18-4236-b9fc-c51541fd0afe"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (3.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (2.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f648cfc0-366c-402f-97dc-1ca59c4e8dff"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 358ms (Views: 263.7ms | ActiveRecord: 3.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2f5a5437-c80d-45b3-bf12-22a08ae969c3"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15) Completed 200 OK in 18ms (Views: 1.1ms | ActiveRecord: 2.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (2.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 82ms (Views: 80.2ms | ActiveRecord: 0.0ms) Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (3.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (2.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 75ms (Views: 65.9ms | ActiveRecord: 1.0ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 21 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 22 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (32) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 23 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.6ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:17:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (732.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.2ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (3.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.6ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.9ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:18:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:22:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b661e9a4-801a-4d3e-8017-20a47ac78786"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-55ef31cc-4418-4681-9a6b-a07a8532d436"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.6ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-6", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-6' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (6) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4) Completed 200 OK in 320ms (Views: 182.7ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ee2bd509-c36b-46f6-8fcd-5188aa5d426a"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 17ms (Views: 1.4ms | ActiveRecord: 2.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b526cd15-bcf1-4bc4-a15c-0f4c335e54d3"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] SQL (1.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 73ms (Views: 66.7ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.8ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 55ms (Views: 54.2ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 33 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (2.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:22:34 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 36 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:22:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.2ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 25) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 25], ["subject_type", "Category"]] SQL (0.7ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) ROLLBACK  (109.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.4ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.4ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.5ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (5.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.0ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (56.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:00 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 201ms (Views: 200.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (2.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-80a16665-575f-42e3-a2fb-e44a4e18771c"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-bb34c366-4062-4d9c-92ef-2fdac4ee03d2"], ["updated_at", Sun, 24 Aug 2014 11:26:01 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1b246a63-870a-4c40-88a5-ddbece9f77a8"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 71ms (Views: 56.6ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d3b534f4-cf59-4418-9b43-d7064c546446"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 16ms (Views: 1.1ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 65ms (Views: 58.9ms | ActiveRecord: 0.5ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (3.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (2.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.3ms | ActiveRecord: 0.6ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 2.1ms | ActiveRecord: 0.8ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.3ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:26:02 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 36], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 36]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:26:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (5.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.5ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (55.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 208ms (Views: 202.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 1 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.8ms | ActiveRecord: 1.8ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b6c9906c-0b94-4471-aa92-e445157aa31c"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (7) Completed 200 OK in 71ms (Views: 56.7ms | ActiveRecord: 1.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e8012d75-c82c-4eae-938e-fb1f96e1f768"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9) Completed 200 OK in 17ms (Views: 1.4ms | ActiveRecord: 2.1ms)  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (1.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3428e48a-8072-43a2-8527-d34a8e4a494c"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7e91a7b3-c2ac-4177-a3be-0a510f2cb9b7"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:27:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 281ms (Views: 280.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (1.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.0ms) Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.4ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:27:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (5.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:27:16 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.4ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (411.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (288.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.5ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.6ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 7 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:27:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 187ms (Views: 185.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 65ms (Views: 53.6ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (18) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 0.7ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 11ms (Views: 1.5ms | ActiveRecord: 0.7ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 18]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-59a6ddc7-b410-447f-ac27-2600d031cc6f"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:27:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4dbf477d-42a4-47c5-a9bc-d27d21f4d65a"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-33", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-33' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33) Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21) Completed 200 OK in 78ms (Views: 60.8ms | ActiveRecord: 2.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 22]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e9a0f3a0-b63d-490d-9bd1-20d85dc0441c"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-36", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-36' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (36) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (23) Completed 200 OK in 16ms (Views: 1.3ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (3.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4b8cbcbb-954f-4c88-8e0c-56a5e2064201"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:28:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (61.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-dffe6c08-08fe-461e-8c2a-340d362fb2ea"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-41ba8d97-5eab-48b8-93e3-e8ef745ce179"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-312d0d79-582f-483a-9970-69122f3c7660"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 341ms (Views: 251.8ms | ActiveRecord: 2.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (2.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-613c7544-5809-4da8-b152-d0d03e292f52"], ["updated_at", Sun, 24 Aug 2014 11:29:23 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-12", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-12' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8) Completed 200 OK in 21ms (Views: 3.0ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (2.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 66ms (Views: 62.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 66ms (Views: 59.8ms | ActiveRecord: 0.5ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 15 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (2.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:29:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.5ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 34 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 36], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 36]] SQL (1.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 37 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:29:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 1 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:36:42 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.4ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5f75a5c8-db37-4776-be46-382c231ec0f0"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fe41af12-00eb-4e13-a70e-2e7c54e382fb"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (1.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (4.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-36a5954a-8117-4b1f-84a7-ba2e3937f773"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 267ms (Views: 195.2ms | ActiveRecord: 2.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-cc8c2a2d-5f98-4c84-9266-fb99b01ed7b6"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:36:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15) Completed 200 OK in 16ms (Views: 1.7ms | ActiveRecord: 2.1ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 70ms (Views: 69.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 64ms (Views: 58.7ms | ActiveRecord: 0.2ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 21 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 22 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 23 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (34) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (23)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:36:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:36:45 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:36:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (279.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.9ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (81.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 226ms (Views: 224.7ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 11:57:24 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 61ms (Views: 55.3ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 6 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (3.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (7)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (2.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4fb7ba14-8854-444f-8cf7-29c7cce9f8c4"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-97ed8a9a-f54c-4f10-9c8f-d58647382b8a"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 76ms (Views: 58.7ms | ActiveRecord: 2.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c7e42a49-cc81-4527-a614-20cbd8e3ce4b"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16) Completed 200 OK in 13ms (Views: 1.0ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 11:57:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-71c93282-01f8-4ca5-bccf-f62a5a46f229"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", false], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.9ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", true], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 11:57:26 UTC +00:00]] SQL (1.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 25) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 25], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.2ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (288.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.0ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (25.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:01:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.5ms) Completed 200 OK in 211ms (Views: 204.6ms | ActiveRecord: 0.5ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (5)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ca784713-7708-4d89-a1c2-a79442802421"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (2.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (7) Completed 200 OK in 70ms (Views: 57.5ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4e45ac05-3091-4fb6-8cfb-89f7690f8c29"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9) Completed 200 OK in 14ms (Views: 1.8ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c6aeb3b7-fe45-4bdf-b554-af808afca435"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:01:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9f3fb5f9-5c23-4d43-8c32-5f3af7754cd4"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 114ms (Views: 113.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:01:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.4ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (4.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (56.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 3 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 4], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 4]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (2.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 6 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:02:11 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (1.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.1ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 188ms (Views: 181.6ms | ActiveRecord: 0.1ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (3.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.7ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 62ms (Views: 61.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:12 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (1.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 18]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2d474b44-fc16-4c97-9147-843ed2787583"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-30", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-30' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (19) Completed 200 OK in 71ms (Views: 57.8ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d10d7098-c906-48e1-817d-1480c4a0f5b9"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-33", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-33' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21) Completed 200 OK in 14ms (Views: 1.2ms | ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 22]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-579d2ba2-ba3d-474f-b227-2ed6d854bce6"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d879f364-392b-4a24-9c24-55a59bc87abc"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:02:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.9ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (54.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f942c75c-f25a-4a9b-adcf-57e666f5ff2c"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-44a66f7a-eab8-48f4-8761-02df6da21b09"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-6", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-6' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (6) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4) Completed 200 OK in 269ms (Views: 177.5ms | ActiveRecord: 3.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0a268ad7-428a-443b-aa6c-f64b8baf2da1"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 14ms (Views: 1.3ms | ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c96eb5a0-c042-441f-93e4-e3e825e32a44"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:02:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 53.5ms | ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (21) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 55ms (Views: 54.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (273.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (56.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 201ms (Views: 199.9ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 4ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 63ms (Views: 56.8ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 7 LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.8ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.4ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c5fc9cfa-95d5-4e1a-a5eb-b585cea4e126"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c950a6e6-b866-4519-bde9-cc52c2cf64d1"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 76ms (Views: 62.9ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:40 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-937d93c2-4509-42d1-b122-babb9f3cbb47"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16) Completed 200 OK in 15ms (Views: 1.9ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e8ad83fd-a458-42df-81c0-bc6c62ea5749"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:06:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (1.3ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (107.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (271.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.3ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.1ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.1ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.8ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (278.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (10.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.5ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8f3f2c4e-674d-4e9b-a88f-c0f1d29f0233"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-eb20887c-adbc-4d5e-ade7-274706a499bc"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:13:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-6", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-6' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (6) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4) Completed 200 OK in 306ms (Views: 218.5ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fc149009-da14-43b4-aaf2-87328bb41a06"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 16ms (Views: 2.1ms | ActiveRecord: 1.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e56a48bd-3361-4e08-ad5a-af611a267b95"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 80ms (Views: 71.1ms | ActiveRecord: 0.7ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.6ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.4ms | ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:13:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 78ms (Views: 77.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 33 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 36 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 22  (0.4ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:13:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 25) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 25], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (108.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.6ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.1ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (1.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.9ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.6ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:14:05 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.5ms) RELEASE SAVEPOINT active_record_1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-20681a75-6eec-4fa8-8969-d257ad2236ed"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-702e30f4-b517-4858-9dbe-d826fb339ccb"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 336ms (Views: 265.0ms | ActiveRecord: 2.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-61c1b13e-6b58-41fc-b110-06b2e3288cef"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 17ms (Views: 1.2ms | ActiveRecord: 2.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7a3284fe-3292-44a5-a430-cb23135f35b1"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:14:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 60.0ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 13ms (Views: 2.0ms | ActiveRecord: 1.3ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 20 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (28) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 79ms (Views: 77.6ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (32) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (34) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (23)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:14:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.5ms) DROP DATABASE IF EXISTS "power_shop_test"  (274.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.8ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.0ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.2ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.9ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.8ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.7ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.9ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (2.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:14:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 7) SQL (0.7ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.7ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 7], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 7]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 7], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 7]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 218ms (Views: 216.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (10) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9b9a04df-d5d8-415b-aa2c-261a4aead1b2"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-49b294cb-32e2-413b-a8bc-92bc8c70dac7"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-51b44100-dd90-4af7-b5d6-6c43e8140495"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18) Completed 200 OK in 72ms (Views: 58.3ms | ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d7dbaa12-126a-4e7d-bf59-6164c6b790ef"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (1.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (20) Completed 200 OK in 22ms (Views: 2.8ms | ActiveRecord: 3.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 72ms (Views: 62.9ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 21 LIMIT 25 OFFSET 0) subquery_for_count  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (3.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (1.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 22 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (32) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.9ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 24 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (36) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (24)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:14:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 11ms (Views: 3.2ms | ActiveRecord: 0.6ms)  (0.3ms) ROLLBACK  (108.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (294.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.2ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.3ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:15:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 222ms (Views: 220.6ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 67ms (Views: 60.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:15:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-71fccbbe-8f37-4fbd-8c07-36ef183dade8"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fbdd6529-7a50-45d9-bd4b-89dd033c318f"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 70ms (Views: 57.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ebf90d0e-1884-4242-bd1c-51f1523b91b3"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16) Completed 200 OK in 15ms (Views: 1.2ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-eff3814a-1ea3-4fb5-9dba-e277707111a8"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.7ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:15:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:15:14 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:15:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 25) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 25], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 25]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 25]]  (0.1ms) ROLLBACK  (107.9ms) DROP DATABASE IF EXISTS "power_shop_test"  (283.9ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.8ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.1ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.8ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.6ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (2.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.9ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (57.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.5ms) Completed 200 OK in 208ms (Views: 202.1ms | ActiveRecord: 0.5ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:15:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 4 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 136ms (Views: 134.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ae42b1e2-3ad6-4999-880e-cf6f44a69010"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12) Completed 200 OK in 73ms (Views: 60.6ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:15:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e9c0b094-5de8-4f38-941c-f06d367708b8"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 13ms (Views: 1.1ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-863560f0-b23f-4c18-9b8f-a391d098b3e0"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8e014ebb-a846-4754-9fbc-54031e0c632a"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 36 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.9ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] Category Load (48.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (3.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 39 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:15:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.3ms) BEGIN ShoppingCart Load (0.6ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.5ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (269.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (17.4ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.0ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (6.6ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.1ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.3ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (59.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:16:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 186ms (Views: 179.8ms | ActiveRecord: 0.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 2 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 3 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 2.2ms | ActiveRecord: 1.4ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 5 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 100ms (Views: 98.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (1.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-521b4d0e-a40c-46d3-b5d6-84fd2838bbfd"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:16:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (12) Completed 200 OK in 77ms (Views: 59.3ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f56c559d-a1e9-4a7d-bed1-0c7750d7ba22"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 15ms (Views: 1.2ms | ActiveRecord: 1.7ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-49dc8d9c-b944-46f1-8ea4-7129c298926c"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4a6506a0-f3ce-4d3a-859e-13ee2e223e8f"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 19) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 33], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 33]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 19 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 19], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 34], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 36 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 37], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 37]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:16:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:16:52 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:16:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 39 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:16:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.2ms) ROLLBACK  (107.3ms) DROP DATABASE IF EXISTS "power_shop_test"  (678.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.2ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.1ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (3.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.0ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.4ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.9ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.6ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.7ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:17:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-25a3a415-321a-4db2-a291-d3b59941d40d"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6ac03b2a-6a80-4182-bd40-80098a25586f"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (1.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (13) Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 260ms (Views: 187.5ms | ActiveRecord: 2.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-35116d72-f529-470e-8b01-00e28192f9dc"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (16) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 15ms (Views: 1.3ms | ActiveRecord: 1.9ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-32dc70f9-7252-462f-8296-184ba97f63c0"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 67ms (Views: 60.9ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (20) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 LIMIT 25 OFFSET 0) subquery_for_count  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (24) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 66ms (Views: 65.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (2.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (32) Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (34) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (23)  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Sun, 24 Aug 2014 12:17:52 UTC +00:00]] SQL (1.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"40"}  (108.1ms) DROP DATABASE IF EXISTS "power_shop_test"  (275.2ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.6ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.9ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.7ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.8ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.6ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.4ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (0.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (59.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 189ms (Views: 188.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (5) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:19:03 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 116ms (Views: 109.8ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.2ms | ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (2.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (1.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.6ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (9)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a4f58b15-ea57-4865-9119-4843b7779a54"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 13]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5447d743-8531-4eab-9e80-38cdf7e16a49"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14) Completed 200 OK in 77ms (Views: 59.8ms | ActiveRecord: 2.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d89b424a-099a-4178-9c44-56753b7832ea"], ["updated_at", Sun, 24 Aug 2014 12:19:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16) Completed 200 OK in 15ms (Views: 2.0ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f230d788-ed89-4905-af61-37f5ec391d3d"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:19:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"}  (108.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (6.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (11.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.1ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (2.0ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.7ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.1ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (2.0ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (3.0ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:20:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 227ms (Views: 226.2ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ce5e3f9b-bcc7-4eef-9d8b-52ceaea9d451"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6529a6d4-9adb-427f-8332-289c2ffaa9c2"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-035eae91-5c07-489f-b7e2-371da2064bc9"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 78ms (Views: 57.7ms | ActiveRecord: 2.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-85f3dc68-fc78-4745-95a9-48f201e122ec"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 16ms (Views: 1.3ms | ActiveRecord: 2.5ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 62.5ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.7ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.9ms | ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 12:20:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (31) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.5ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.5ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 12:20:18 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 12:20:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"} Completed 500 Internal Server Error in 8333ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 35 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 36], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 36]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 38 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.3ms) RELEASE SAVEPOINT active_record_1 Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 39], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 39]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Sun, 24 Aug 2014 12:20:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 26]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 26]] SQL (0.8ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 26) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 26]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 40], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 40]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 26 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 26 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 26], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 26]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 26]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (272.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.5ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.5ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.6ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (3.4ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.5ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.0ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (2.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 2 [["active", false], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 5 [["active", true], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (2.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 12:28:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"8"}  (0.1ms) BEGIN ShoppingCart Load (0.7ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.5ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 206ms (Views: 202.0ms | ActiveRecord: 0.5ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 9 LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 17:36:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 11ms (Views: 2.1ms | ActiveRecord: 1.7ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (11) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 11ms (Views: 2.6ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (1.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 2.1ms | ActiveRecord: 0.6ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 13 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (1.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 58ms (Views: 57.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) Product Load (1.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f1bacc7a-5e5f-4bc7-adae-8ad24a24d699"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (31) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (20) Completed 200 OK in 73ms (Views: 63.3ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 21]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-78ce65f6-6819-4e42-8b20-5d56d7f53ee1"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (34) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22) Completed 200 OK in 15ms (Views: 2.1ms | ActiveRecord: 2.1ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 23]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ef6a9cb5-ab34-4e9b-9ee1-469b8f6bfc4c"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0d73d3bb-7f60-44d2-8c25-92375764a537"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 26], ["created_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 17:36:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 27]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 27]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 27) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 27]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 41], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 41]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 27 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 27 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 27], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 27]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 27]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 28], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 42], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 42]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 29], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.8ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 30], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 44 [["active", true], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 31], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 31  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 45], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 45]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 31  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 33]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 33 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 33], ["created_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 33  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 47 [["active", false], ["updated_at", Sun, 24 Aug 2014 17:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 33  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 33]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (2.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:37:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:37:36 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 34]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 34 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 34], ["created_at", Sun, 24 Aug 2014 17:37:36 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:37:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 34  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"48"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "48"]] Completed 500 Internal Server Error in 56ms  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (3.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:38:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:38:56 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 35]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 35 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 35], ["created_at", Sun, 24 Aug 2014 17:38:56 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:38:56 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 35  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"49"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "49"]] Completed 500 Internal Server Error in 13ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:39:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:39:18 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 36]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 36 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 36], ["created_at", Sun, 24 Aug 2014 17:39:18 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:39:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 36  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"50"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "50"]] Completed 500 Internal Server Error in 54ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:39:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:39:44 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 37]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 37 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 37], ["created_at", Sun, 24 Aug 2014 17:39:44 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:39:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 37  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"51"} Completed 500 Internal Server Error in 2ms  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:04 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 38]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 38 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 38], ["created_at", Sun, 24 Aug 2014 17:40:04 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:40:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 38  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"52"} Completed 500 Internal Server Error in 120ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.7ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.6ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 2 LIMIT 1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 39]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 39 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 39], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 39  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 39], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 187ms (Views: 182.4ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 39 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 40]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 40 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 40], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 40  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (2.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 40], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 41]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 41 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 41], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 41  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 41], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 41 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (57) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (41)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 42]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 42 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 42], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 42  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 42], ["created_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 17:40:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.9ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 43]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 43 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 43], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 43  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 43], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 43 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (61) Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (43)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 44]] SQL (2.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 44 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 44], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 44  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 44], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 44]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-f7c349a4-f376-4fc2-a05b-2b56ffce8dcb"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 45]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 45 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 45], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 45  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (65) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (45) Completed 200 OK in 72ms (Views: 61.5ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 46]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 46 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 46], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 46  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 46], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 46]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4be7fcc9-0b41-480b-8e07-ff6168509092"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 47]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 47 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 47], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 47  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (68) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (47) Completed 200 OK in 12ms (Views: 1.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 48]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 48 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 48], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 48  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 48], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 48]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-073a50e0-96e3-4f9e-9833-0331196507ac"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 49]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 49 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 49], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 50]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 50 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 50], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 50  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 50], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 50]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d6cca148-18ff-42af-8162-36016e87afcf"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 51]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 51 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 51], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 51  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 52]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 52 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 52], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 52  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 52], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 57ms (Views: 56.0ms | ActiveRecord: 0.0ms)  (1.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 53]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 53 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 53], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 53  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 53], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 2.3ms | ActiveRecord: 0.0ms) Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (77) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (53)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 54]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 54 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 54], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 54  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 54], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 55]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 55 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 55], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 55  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 55], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (81) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (55)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 56]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 56 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 56], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 56  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 56], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 57]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 57 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 57], ["created_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 24 Aug 2014 17:40:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 57  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"85"} Completed 500 Internal Server Error in 83ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 58 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 58], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 58  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 86], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 86]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 58  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 59]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 59 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 59], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 59  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 87 [["active", false], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 59  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 59]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 60]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 60 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 60], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 60  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 60]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 61 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 61], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 89], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 89]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 62]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 62 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 62], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 90 [["active", true], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 62  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 62]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 63]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 63 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 63], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 63]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 64]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 64 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 64], ["created_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Sun, 24 Aug 2014 17:40:39 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 64  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 64]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 64]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 64) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 64]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 64]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 92], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 92]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 64 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 64 ShopImage Load (1.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 64], ["subject_type", "Category"]] SQL (0.5ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 64]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 64]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:48:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:48:27 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 65]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 65 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 65], ["created_at", Sun, 24 Aug 2014 17:48:27 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:48:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 65  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"93"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "93"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 93 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 93], ["item_type", "PowerShop::Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 1000.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 456ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:50:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:50:33 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 66]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 66 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 66], ["created_at", Sun, 24 Aug 2014 17:50:33 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:50:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 66  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"94"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "94"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 94 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 94], ["item_type", "PowerShop::Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 1000.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 153ms (ActiveRecord: 3.5ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:50:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:50:48 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 67]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 67 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 67], ["created_at", Sun, 24 Aug 2014 17:50:48 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:50:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 67  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"95"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "95"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 95 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 95], ["item_type", "PowerShop::Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 1000.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 167ms (ActiveRecord: 3.6ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:50:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:50:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 68]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 68 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 68], ["created_at", Sun, 24 Aug 2014 17:50:49 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:50:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 68  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"96"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "96"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 96 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 96], ["item_type", "PowerShop::Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 1000.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:51:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:51:15 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 69]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 69 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 69], ["created_at", Sun, 24 Aug 2014 17:51:15 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:51:15 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 69  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"97"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "97"]] PowerShop::ShoppingCartItem Load (1.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 97 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 97], ["item_type", "PowerShop::Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 1000.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 164ms (ActiveRecord: 4.4ms) ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 70]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 70 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 70], ["created_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 70  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"98"} PowerShop::Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "98"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 98 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 98], ["item_type", "PowerShop::Product"], ["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 171ms (ActiveRecord: 4.2ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 71]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 71 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 71], ["created_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:54:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 71  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"99"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "99"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 99 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 99], ["item_type", "PowerShop::Product"], ["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] Category Load (2.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 72]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 72 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 72], ["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 72  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"100"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "100"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 100 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 100], ["item_type", "PowerShop::Product"], ["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 162ms (ActiveRecord: 4.0ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 73]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 73 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 73], ["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 73  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"101"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "101"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 101 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 11], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 101], ["item_type", "PowerShop::Product"], ["owner_id", 11], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.6ms)  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 74]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 74 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 74], ["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 74  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"102"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "102"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 102 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 12], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 102], ["item_type", "PowerShop::Product"], ["owner_id", 12], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (1.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 12], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 75]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 75 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 75], ["created_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 17:55:07 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 75  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"103"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "103"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 103 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 103], ["item_type", "PowerShop::Product"], ["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 76]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 76 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 76], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 76  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 76], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 205ms (Views: 203.6ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 77]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 77 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 77], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 77  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 77], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 78]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 78 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 78], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 78  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 78], ["created_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Sun, 24 Aug 2014 17:56:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (108) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (78)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 79]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 79 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 79], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 79  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 79], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 80]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 80 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 80], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 80  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 80], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (112) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (80)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 81]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 81 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 81], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 81  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 81], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 61ms (Views: 54.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 82]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 82 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 82], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 82  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 82], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.9ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 82 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 83]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 83 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 83], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 83  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 83], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.4ms | ActiveRecord: 1.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 83 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (118) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (83)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 84]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 84 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 84], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 84  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 84], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 85]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 85 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 85], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 85  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 85], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 85 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (122) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (85)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 86]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 86 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 86], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 86  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 86], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 86]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8005c13c-9c8f-4bb0-abdd-ad23eb598229"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 87]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 87 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 87], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 87  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 88]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 88 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 88], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 88  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 88], ["created_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 24 Aug 2014 17:56:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 88]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5eafd171-4d58-4823-904b-9ef08fb6af59"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 89]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 89 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 89], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 89  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (1.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (129) Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (89) Completed 200 OK in 77ms (Views: 58.1ms | ActiveRecord: 3.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 90]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 90 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 90], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 90  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 90], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 90]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-69a21061-d61a-4fe4-84bc-6b879bb0bd97"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 91]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 91 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 91], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 91  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (132) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (91) Completed 200 OK in 14ms (Views: 1.2ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 92]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 92 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 92], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 92  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 92], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 92]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b4215965-c68a-460f-a6f8-18b70e96568b"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 93]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 93 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 93], ["created_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 24 Aug 2014 17:56:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:50 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 94]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 94 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 94], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 94  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 94], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 235ms (Views: 233.9ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 95]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 95 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 95], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 95  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 95], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (138) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (95)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 96]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 96 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 96], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 96  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 96], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 97]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 97 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 97], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 97  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 97], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (142) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (97)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 98]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 98 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 98], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 98  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 98], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 99]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 99 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 99], ["created_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 04:32:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 99  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (4.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 99], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 99]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-51881e3e-9162-4f8f-952b-b7720ec601ad"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 100]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 100 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 100], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 100  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 101]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 101 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 101], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 101  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 101], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 101]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-784a8ec4-5765-4b4e-9b50-0843958ad54b"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 102]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 102 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 102], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 103]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 103 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 103], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 103  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 103], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 103]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-92cb71ba-d4ea-4041-a51c-b1a96ab4d8b3"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 104]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 104 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 104], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 104  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (154) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (104) Completed 200 OK in 73ms (Views: 58.6ms | ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 105]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 105 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 105], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 105  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 105], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 105]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0a682f07-dd33-488f-92d5-a111c81e97d5"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 106]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 106 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 106], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 106  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (157) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (106) Completed 200 OK in 16ms (Views: 1.1ms | ActiveRecord: 2.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 107]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 107 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 107], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 107  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 107], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 74ms (Views: 67.2ms | ActiveRecord: 0.7ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 107 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 108]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 108 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 108], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 108  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 108], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.6ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 108 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (160) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (108)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 109]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 109 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 109], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 109  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 109], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.6ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 110]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 110 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 110], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 110  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 110], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 111]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 111 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 111], ["created_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 04:32:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 111  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 111], ["created_at", Mon, 25 Aug 2014 04:32:53 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 04:32:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 111 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (166) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (111)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 112]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 112 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 112], ["created_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 112  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 112], ["created_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:34:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 195ms (Views: 188.2ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 112 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (168) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (112)  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 113]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 113 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 113], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 113  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 113], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 114]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 114 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 114], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 114  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 114], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 13ms (Views: 1.2ms | ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 115]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 115 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 115], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 115  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 115], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.3ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 115 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (174) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (115)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 116]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 116 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 116], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 116  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 116], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.6ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 116 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 117]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 117 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 117], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 117  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 117], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 60ms (Views: 58.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 118]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 118 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 118], ["created_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 04:34:14 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 118  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 118], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 119]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 119 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 119], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 119  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 119], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 120]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 120 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (2.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 120], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 120  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 120], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (184) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (120)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 121]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 121 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 121], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 121  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 121], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (186) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (121)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 122]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 122 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 122], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 122  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 122], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 122]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6fb5c89f-5507-44b6-9937-007692a0dc06"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 123]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 123 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 123], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 123  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (190) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (123) Completed 200 OK in 76ms (Views: 58.9ms | ActiveRecord: 2.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 124]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 124 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 124], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 124  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 124], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 124]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-720f77d0-e473-4b05-9f49-e614a970003f"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 125]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 125 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 125], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 125  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (193) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (125) Completed 200 OK in 13ms (Views: 1.0ms | ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 126]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 126 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 126], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 126  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 126], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 126]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8c1fade3-2e6b-4499-9eef-89313f55e5a8"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 127]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 127 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 127], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 127  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 128]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 128 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 128], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 128  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 128], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 128]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6b153e63-110b-43c4-bcd4-a1d259fc3dfb"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 129]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 129 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 129], ["created_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 04:34:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 130]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 130 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 130], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 130  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 130], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 191ms (Views: 185.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 130 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (200) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (130)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 131]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 131 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 131], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 131  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 131], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.8ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 131 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (202) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (131)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 132]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 132 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 132], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 132  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 132], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 133]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 133 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 133], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 133  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 133], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 133 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 134]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 134 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 134], ["created_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 04:34:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 134  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 134], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 135]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 135 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 135], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 135  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 135], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 51ms (Views: 50.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 136]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 136 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 136], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 136  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 136], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 137]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 137 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 137], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 137  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 137], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (214) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (137)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 138]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 138 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 138], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 138  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 138], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 139]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 139 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 139], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 139  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 139], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (218) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (139)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 140]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 140 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 140], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 140  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 140], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 140]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ec4b8226-64b9-4c62-8188-811da2372e19"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 141]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 141 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 141], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 141  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-23", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-23' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (222) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (141) Completed 200 OK in 68ms (Views: 55.0ms | ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 142]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 142 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 142], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 142  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 142], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 142]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5be5c904-a6c3-46b4-afd3-056693637fdd"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 143]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 143 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 143], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 143  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (225) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (143) Completed 200 OK in 16ms (Views: 1.3ms | ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 144]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 144 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 144], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 144  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 144], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 144]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e0ba9ff3-f62c-4558-ae76-b5bb44e15db9"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 145]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 145 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 145], ["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 145  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:34:35 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 146]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 146 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 146], ["created_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 146  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 146], ["created_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 146]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-00fd61fd-55f9-4cec-907d-224a0bd882d9"], ["updated_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 147]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 147 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 147], ["created_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 04:34:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 148]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 148 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 148], ["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 148  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 148], ["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 184ms (Views: 183.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 149]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 149 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 149], ["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 149  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 149], ["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:10 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 150]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 150 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 150], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 150  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 150], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 5ms (Views: 2.4ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (236) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (150)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 151]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 151 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 151], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 151  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 151], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 152]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 152 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 152], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 152  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 152], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (240) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (152)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 153]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 153 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 153], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 153  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (2.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 153], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 65ms (Views: 57.4ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 154]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 154 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 154], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 154  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 154], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 154 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (244) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (154)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 155]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 155 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 155], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 155  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 155], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 155 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (246) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (155)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 156]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 156 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 156], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 156  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 156], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 157]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 157 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 157], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 157  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 157], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 157 LIMIT 25 OFFSET 0) subquery_for_count  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 158]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 158 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 158], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 158  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 158], ["created_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 04:36:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 158]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a3d3f85a-07ca-4045-a291-bb367fc58c40"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 159]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 159 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 159], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 159  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 160]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 160 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 160], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 160  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 160], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 160]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-02a4cdd6-e578-4d90-b623-7f6c37594833"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 161]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 161 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 161], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 161  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (257) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (161) Completed 200 OK in 69ms (Views: 56.1ms | ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 162]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 162 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 162], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 162  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 162], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 162]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3838b513-d9cc-4f7f-8a08-8c5900e37bdb"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 163]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 163 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 163], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 163  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (260) Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (163) Completed 200 OK in 16ms (Views: 1.4ms | ActiveRecord: 2.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 164]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 164 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 164], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 164  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 164], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 164]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-7fd05d9b-b726-43ab-b825-06e414038436"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 165]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 165 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 165], ["created_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 04:36:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 166]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 166 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 166], ["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 166  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 167]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 167 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 167], ["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 167  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"265"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "265"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 265 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 15], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 265], ["item_type", "PowerShop::Product"], ["owner_id", 15], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 206ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 168]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 168 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 168], ["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 168  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"266"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "266"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 266 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 16], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 266], ["item_type", "PowerShop::Product"], ["owner_id", 16], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 9ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 169]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 169 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 169], ["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 169  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"267"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "267"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 267 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 17], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 267], ["item_type", "PowerShop::Product"], ["owner_id", 17], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 10ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 170]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 170 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 170], ["created_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:36:29 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 170  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"268"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "268"]] PowerShop::ShoppingCartItem Load (1.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 268 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 18], ["owner_type", "PowerShop::ShoppingCart"]]  (0.5ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 268], ["item_type", "PowerShop::Product"], ["owner_id", 18], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 15ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 171]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 171 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 171], ["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 171  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"269"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "269"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 269 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 20], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 269], ["item_type", "PowerShop::Product"], ["owner_id", 20], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 163ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 172]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 172 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 172], ["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 172  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"270"} PowerShop::Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "270"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 270 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 21], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 270], ["item_type", "PowerShop::Product"], ["owner_id", 21], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 11ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 173]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 173 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 173], ["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 173  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"271"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "271"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 271 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 22], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 271], ["item_type", "PowerShop::Product"], ["owner_id", 22], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 7ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 174]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 174 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 174], ["created_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:37:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 174  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"272"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "272"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 272 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 23], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 272], ["item_type", "PowerShop::Product"], ["owner_id", 23], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 15ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 175]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 175 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 175], ["created_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 175  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"273"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "273"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 273 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 25], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 273], ["item_type", "PowerShop::Product"], ["owner_id", 25], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 160ms (ActiveRecord: 3.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 176]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 176 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 176], ["created_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:39:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 176  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"274"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "274"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 274 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 274], ["item_type", "PowerShop::Product"], ["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 177]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 177 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 177], ["created_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 177  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"275"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "275"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 275 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 275], ["item_type", "PowerShop::Product"], ["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 178]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 178 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 178], ["created_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:39:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 178  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"276"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "276"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 276 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 276], ["item_type", "PowerShop::Product"], ["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:31 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 179]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 179 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 179], ["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 179  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"277"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "277"]] PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 277 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 30], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 277], ["item_type", "PowerShop::Product"], ["owner_id", 30], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 168ms (ActiveRecord: 5.1ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 30], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 180]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 180 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 180], ["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 180  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"278"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "278"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 278 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 31], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 278], ["item_type", "PowerShop::Product"], ["owner_id", 31], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 181]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 181 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 181], ["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 181  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"279"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "279"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 279 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 279], ["item_type", "PowerShop::Product"], ["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.6ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 182]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 182 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 182], ["created_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:40:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 182  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"280"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "280"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 280 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 280], ["item_type", "PowerShop::Product"], ["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 15ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:48 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:48 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 183]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 183 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 183], ["created_at", Mon, 25 Aug 2014 04:40:48 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:40:48 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 183  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"281"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "281"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 281 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 34], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 281], ["item_type", "PowerShop::Product"], ["owner_id", 34], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 159ms (ActiveRecord: 3.7ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 184]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 184 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 184], ["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 184  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"282"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "282"]] PowerShop::ShoppingCartItem Load (1.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 282 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 35], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 282], ["item_type", "PowerShop::Product"], ["owner_id", 35], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 2.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 35], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 185]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 185 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 185], ["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 185  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"283"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "283"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 283 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 283], ["item_type", "PowerShop::Product"], ["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 186]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 186 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 186], ["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 186  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"284"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "284"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 284 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 284], ["item_type", "PowerShop::Product"], ["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.6ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 187]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 187 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 187], ["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 187  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 188]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 188 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 188], ["created_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:40:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 188  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (16.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 189]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 189 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 189], ["created_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 189  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"287"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "287"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 287 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 40], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 287], ["item_type", "PowerShop::Product"], ["owner_id", 40], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 163ms (ActiveRecord: 3.3ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 190]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 190 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 190], ["created_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 190  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"288"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "288"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 288 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 41], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 288], ["item_type", "PowerShop::Product"], ["owner_id", 41], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.6ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 41], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 191]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 191 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 191], ["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 191  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"289"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "289"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 289 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 42], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 289], ["item_type", "PowerShop::Product"], ["owner_id", 42], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 42], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 192]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 192 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 192], ["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 192  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"290"} PowerShop::Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "290"]] PowerShop::ShoppingCartItem Load (1.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 290 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 290], ["item_type", "PowerShop::Product"], ["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 15ms (ActiveRecord: 3.7ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 193]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 193 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 193], ["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 193  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"291"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "291"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 291 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 44], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 291], ["item_type", "PowerShop::Product"], ["owner_id", 44], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 194]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 194 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 194], ["created_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:41:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 194  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"292"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "292"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 292 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 45], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 292], ["item_type", "PowerShop::Product"], ["owner_id", 45], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 13ms (Views: 0.1ms | ActiveRecord: 1.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 195]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 195 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 195], ["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 195  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"293"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "293"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 293 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 293], ["item_type", "PowerShop::Product"], ["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 181ms (ActiveRecord: 4.3ms)  (0.6ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 196]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 196 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 196], ["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 196  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"294"} PowerShop::Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "294"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 294 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 294], ["item_type", "PowerShop::Product"], ["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 2.6ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 197]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 197 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 197], ["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 197  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"295"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "295"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 295 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 48], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 295], ["item_type", "PowerShop::Product"], ["owner_id", 48], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 198]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 198 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 198], ["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 198  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"296"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "296"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 296 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 296], ["item_type", "PowerShop::Product"], ["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 199]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 199 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 199], ["created_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:42:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 199  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"297"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "297"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 297 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 50], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 297], ["item_type", "PowerShop::Product"], ["owner_id", 50], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 7ms (Views: 0.1ms | ActiveRecord: 1.4ms)  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 200]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 200 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 200], ["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 200  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"298"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "298"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 298 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 51], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 298], ["item_type", "PowerShop::Product"], ["owner_id", 51], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 156ms (ActiveRecord: 4.4ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 51], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 201]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 201 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 201], ["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 201  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"299"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "299"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 299 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 52], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 299], ["item_type", "PowerShop::Product"], ["owner_id", 52], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 202]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 202 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 202], ["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 202  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"300"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "300"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 300 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 53], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 300], ["item_type", "PowerShop::Product"], ["owner_id", 53], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 53], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 203]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 203 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 203], ["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 203  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"301"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "301"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 301 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 54], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 301], ["item_type", "PowerShop::Product"], ["owner_id", 54], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 54], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 204]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 204 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 204], ["created_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:42:44 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 204  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"302"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "302"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 302 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 55], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 302], ["item_type", "PowerShop::Product"], ["owner_id", 55], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:42:45 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:42:45 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 205]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 205 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 205], ["created_at", Mon, 25 Aug 2014 04:42:45 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:42:45 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 205  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"303"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "303"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 303 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 56], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 303], ["item_type", "PowerShop::Product"], ["owner_id", 56], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (17.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:45:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:45:55 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 206]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 206 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 206], ["created_at", Mon, 25 Aug 2014 04:45:55 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:45:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 206  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"304"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "304"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 304 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 57], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 304], ["item_type", "PowerShop::Product"], ["owner_id", 57], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 200 OK in 180ms (Views: 0.1ms | ActiveRecord: 3.8ms)  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:50:14 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:50:14 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 207]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 207 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 207], ["created_at", Mon, 25 Aug 2014 04:50:14 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:50:14 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 207  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"305"} PowerShop::Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "305"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 305 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 305], ["item_type", "PowerShop::Product"], ["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 166ms (Views: 0.2ms | ActiveRecord: 4.1ms)  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (2.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 208]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 208 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 208], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 208  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"306"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "306"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 306 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 59], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 306], ["item_type", "PowerShop::Product"], ["owner_id", 59], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 156ms (ActiveRecord: 3.8ms) PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 59], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 209]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 209 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 209], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 209  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"307"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "307"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 307 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 307], ["item_type", "PowerShop::Product"], ["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 210]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 210 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 210], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 210  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"308"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "308"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 308 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 61], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 308], ["item_type", "PowerShop::Product"], ["owner_id", 61], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 211]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 211 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 211], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 211  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"309"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "309"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 309 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 309], ["item_type", "PowerShop::Product"], ["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.2ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 212]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 212 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 212], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 212  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"310"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "310"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 310 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 63], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 310], ["item_type", "PowerShop::Product"], ["owner_id", 63], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 63], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.1ms | ActiveRecord: 2.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 213]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 213 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 213], ["created_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:51:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 213  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"311"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "311"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 311 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 64], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 311], ["item_type", "PowerShop::Product"], ["owner_id", 64], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 64], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.7ms)  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 214]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 214 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 214], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 214  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"312"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "312"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 312 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 65], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 312], ["item_type", "PowerShop::Product"], ["owner_id", 65], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 174ms (ActiveRecord: 3.5ms) PowerShop::ShoppingCartItem Load (1.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 65], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 215]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 215 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 215], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 215  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"313"} PowerShop::Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "313"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 313 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 66], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 313], ["item_type", "PowerShop::Product"], ["owner_id", 66], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.6ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 66], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 216]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 216 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 216], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 216  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"314"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "314"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 314 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 67], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 314], ["item_type", "PowerShop::Product"], ["owner_id", 67], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 217]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 217 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 217], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 217  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"315"} PowerShop::Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "315"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 315 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"]]  (0.7ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 315], ["item_type", "PowerShop::Product"], ["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 15ms (ActiveRecord: 3.0ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 218]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 218 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 218], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 218  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"316"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "316"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 316 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 316], ["item_type", "PowerShop::Product"], ["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 219]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 219 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 219], ["created_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:52:51 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 219  (1.0ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"317"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "317"]] PowerShop::ShoppingCartItem Load (0.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 317 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 317], ["item_type", "PowerShop::Product"], ["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 220]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 220 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 220], ["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 220  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"318"} PowerShop::Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "318"]] PowerShop::ShoppingCartItem Load (1.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 318 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 318], ["item_type", "PowerShop::Product"], ["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 180ms (Views: 0.2ms | ActiveRecord: 6.3ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 221]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 221 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 221], ["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 221  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"319"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "319"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 319 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 319], ["item_type", "PowerShop::Product"], ["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.2ms | ActiveRecord: 2.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 222]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 222 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 222], ["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 222  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"320"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "320"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 320 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 320], ["item_type", "PowerShop::Product"], ["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 223]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 223 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 223], ["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 223  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"321"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "321"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 321 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 74], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 321], ["item_type", "PowerShop::Product"], ["owner_id", 74], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 224]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 224 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 224], ["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 224  (0.6ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"322"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "322"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 322 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 75], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 322], ["item_type", "PowerShop::Product"], ["owner_id", 75], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 75], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:11 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 225]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 225 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 225], ["created_at", Mon, 25 Aug 2014 04:53:12 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:53:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 225  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"323"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "323"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 323 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 76], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 323], ["item_type", "PowerShop::Product"], ["owner_id", 76], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 76], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:58 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 226]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 226 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 226], ["created_at", Mon, 25 Aug 2014 04:53:58 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:53:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 226  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"324"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "324"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 324 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 77], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 324], ["item_type", "PowerShop::Product"], ["owner_id", 77], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 77], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 158ms (Views: 0.2ms | ActiveRecord: 3.8ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 227]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 227 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 227], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 227  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"325"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "325"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 325 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 78], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 325], ["item_type", "PowerShop::Product"], ["owner_id", 78], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 78], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 228]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 228 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 228], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 228  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"326"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "326"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 326 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 326], ["item_type", "PowerShop::Product"], ["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 229]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 229 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 229], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 229  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"327"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "327"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 327 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 80], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 327], ["item_type", "PowerShop::Product"], ["owner_id", 80], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 230]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 230 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 230], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 230  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"328"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "328"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 328 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 328], ["item_type", "PowerShop::Product"], ["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 231]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 231 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 231], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 231  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"329"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "329"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 329 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 329], ["item_type", "PowerShop::Product"], ["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 232]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 232 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 232], ["created_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:53:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 232  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"330"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "330"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 330 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 330], ["item_type", "PowerShop::Product"], ["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 233]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 233 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 233], ["created_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 331 [["active", true], ["updated_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 233  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 233]]  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 234]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 234 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 234], ["created_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 04:54:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 332], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 332]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 234]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 235]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 235 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 235], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 235]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 236]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 236 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 236], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 236  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 334 [["active", false], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 236  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 236]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 237]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 237 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 237], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 237  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 237]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 237]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 335], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 335]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 237  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 237]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 238]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 238 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 238], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 238  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 238]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 239]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 239 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 239], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 239  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 239]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 239]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 239) SQL (0.2ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 239]] Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 239]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 337], ["subject_type", "Product"]] SQL (1.1ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 337]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 239 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 239 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 239], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 239]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 239]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.3ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 84 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 240]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 240 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 240], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 240  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 240], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 240]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-843da1fa-3a15-4613-9d7c-428a0d5fabed"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 241]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 241 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 241], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 242]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 242 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 242], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 242  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 242], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 242]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-d3b00f5c-3bd7-4638-b1ab-a244859c1558"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 243]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 243 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 243], ["created_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 04:54:16 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 243  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-13", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-13' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (343) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (243) Completed 200 OK in 869ms (Views: 761.0ms | ActiveRecord: 1.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 244]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 244 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 244], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 244  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 244], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 244]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c4ac95fe-7fe0-4290-8217-729f5d02587c"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 245]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 245 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 245], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 245  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (346) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (245) Completed 200 OK in 14ms (Views: 1.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 246]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 246 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 246], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 246  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 246], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 246]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-799632da-dc1a-4f8f-a9a5-14fc8361203d"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 247]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 247 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 247], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 247  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 248]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 248 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 248], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 248  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 248], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 58ms (Views: 52.5ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 248 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (350) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (248)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 249]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 249 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 249], ["created_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 04:54:17 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 249  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 249], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.0ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 249 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (352) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (249)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 250]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 250 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 250], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 250  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 250], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 250 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 251]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 251 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 251], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 251  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 251], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 252]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 252 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 252], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 252  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 252], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 253]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 253 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 253], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 253  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 253], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 121ms (Views: 120.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 254]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 254 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 254], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 254  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 254], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (362) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (254)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 255]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 255 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 255], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 255  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 255], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (364) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (255)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 256]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 256 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 256], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 256  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 256], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 257]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 257 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 257], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 257  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 257], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 258]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 258 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 258], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-40"], ["price", 500.0], ["slug", "test-product-40"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 258  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"370"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "370"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 370 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 85], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 370], ["item_type", "PowerShop::Product"], ["owner_id", 85], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 85], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 129ms (Views: 0.2ms | ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 259]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 259 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 259], ["created_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00], ["name", "Test product-41"], ["price", 500.0], ["slug", "test-product-41"], ["updated_at", Mon, 25 Aug 2014 04:54:18 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 259  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"371"} PowerShop::Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "371"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 371 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 371], ["item_type", "PowerShop::Product"], ["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.1ms | ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 260]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 260 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 260], ["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["name", "Test product-42"], ["price", 500.0], ["slug", "test-product-42"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 260  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"372"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "372"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 372 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 372], ["item_type", "PowerShop::Product"], ["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 261]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 261 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 261], ["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["name", "Test product-43"], ["price", 500.0], ["slug", "test-product-43"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] SQL (1.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 261  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"373"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "373"]] PowerShop::ShoppingCartItem Load (1.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 373 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 88], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 373], ["item_type", "PowerShop::Product"], ["owner_id", 88], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 2.2ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 88], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 262]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 262 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 262], ["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["name", "Test product-44"], ["price", 500.0], ["slug", "test-product-44"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 262  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"374"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "374"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 374 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 89], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 374], ["item_type", "PowerShop::Product"], ["owner_id", 89], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 89], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 263]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 263 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 263], ["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["name", "Test product-45"], ["price", 500.0], ["slug", "test-product-45"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 263  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"375"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "375"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 375 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 375], ["item_type", "PowerShop::Product"], ["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 264]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 264 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 264], ["created_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00], ["name", "Test product-46"], ["price", 500.0], ["slug", "test-product-46"], ["updated_at", Mon, 25 Aug 2014 04:54:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 264  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"376"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "376"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 376 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 91], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 376], ["item_type", "PowerShop::Product"], ["owner_id", 91], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (16.5ms) BEGIN  (17.6ms) SAVEPOINT active_record_1 SQL (153.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (98.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 265]] SQL (20.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 265 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 265], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (11.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 265  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"377"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "377"]] Completed 500 Internal Server Error in 15ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 266]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 266 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 266], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 266  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"378"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "378"]] Completed 500 Internal Server Error in 4ms  (1.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 267]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 267 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 267], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 267  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"379"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "379"]] Completed 500 Internal Server Error in 2ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 268]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 268 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 268], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 268  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"380"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "380"]] Completed 500 Internal Server Error in 2ms  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 269]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 269 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 269], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 269  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"381"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "381"]] Completed 500 Internal Server Error in 2ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 270]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 270 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 270], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 270  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"382"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "382"]] Completed 500 Internal Server Error in 2ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 271]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 271 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 271], ["created_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 05:11:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 271  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"383"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "383"]] Completed 500 Internal Server Error in 3ms  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 272]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 272 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 272], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 272  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 272], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 272]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0d324c92-4701-41d1-9a56-b60f9553aab6"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 273]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 273 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 273], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 274]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 274 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 274], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 274  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 274], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 274]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-2300eff7-e82e-4c53-8659-9fcf19279cf5"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 275]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 275 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 275], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 275  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 276]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 276 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 276], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 276  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 276], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 276]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fa91a4a5-3d7a-484c-a66b-dd149a1639df"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 277]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 277 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 277], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 277  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-16", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-16' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (392) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (277) Completed 200 OK in 321ms (Views: 212.4ms | ActiveRecord: 2.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (3.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 278]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 278 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 278], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 278  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 278], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 278]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-9fce7698-ce5b-4346-9bb4-b01163d82de8"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 279]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 279 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 279], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 279  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (395) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (279) Completed 200 OK in 18ms (Views: 2.4ms | ActiveRecord: 2.2ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 280]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 280 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 280], ["created_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 05:11:51 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 280  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 280], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 65ms (Views: 63.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 281]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 281 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 281], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 281  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 281], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (398) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (281)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 282]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 282 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 282], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 282  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 282], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (400) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (282)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 283]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 283 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 283], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 283  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 283], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 284]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 284 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 284], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 284  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 284], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 285]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 285 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 285], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 285  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 285], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 64ms (Views: 58.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 286]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 286 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 286], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 286  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 286], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 286 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (408) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (286)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (19.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 287]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 287 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 287], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 287  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 287], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.6ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 288]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 288 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 288], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 288  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 288], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 288 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (412) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (288)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 289]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 289 ORDER BY "categories"."lft")  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 289], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 289  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 289], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 2.4ms | ActiveRecord: 0.5ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 289 LIMIT 25 OFFSET 0) subquery_for_count  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 290]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 290 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 290], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 290  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 416 [["active", false], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 290  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 290]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 291]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 291 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 291], ["created_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Mon, 25 Aug 2014 05:11:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 291  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 291]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 292]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 292 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 292], ["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 292  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 292]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 292]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 418], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 418]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 292  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 292]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 293]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 293 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 293], ["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 419 [["active", true], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 293  (0.3ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 293]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 294]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 294 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 294], ["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 294]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 295]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 295 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 295], ["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (1.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 421], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 421]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 295]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 296]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 296 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 296], ["created_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Mon, 25 Aug 2014 05:11:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 296  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 296]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 296]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 296) SQL (0.3ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 296]] Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 296]] ShopImage Load (0.2ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 422], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 422]] SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 296 SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 296 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 296], ["subject_type", "Category"]] SQL (1.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 296]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 296]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (28.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 99 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (66.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:09 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:09 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 297]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 297 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 297], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 297  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 297], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.3ms) Completed 200 OK in 186ms (Views: 184.4ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (423) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (297)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 298]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 298 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 298], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 298  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 298], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 299]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 299 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 299], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 299  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 299], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (427) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (299)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 300]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 300 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 300], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 300  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 300], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 301]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 301 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 301], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 301  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 301], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 302]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 302 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 302], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 302  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 302], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (2.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 302]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-936819c9-2738-4337-bceb-b06a657efb11"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 303]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 303 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 303], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 303  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 304]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 304 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 304], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 304  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 304], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 304]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-44f920ea-0168-4eb4-9067-92de34397b17"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 305]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 305 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 305], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 306]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 306 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 306], ["created_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Mon, 25 Aug 2014 05:12:10 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 306  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 306], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 306]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c0c6456f-e175-4ec2-92f2-0afc8e5f25a7"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 307]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 307 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 307], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 307  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (441) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (307) Completed 200 OK in 79ms (Views: 62.5ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 308]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 308 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 308], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 308  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (2.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 308], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 308]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6dc0ff54-9a9b-424f-be03-8eb4699eaaef"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 309]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 309 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 309], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 309  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (444) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (309) Completed 200 OK in 14ms (Views: 1.3ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 310]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 310 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 310], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 310  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 310], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 65ms (Views: 58.9ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 311]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 311 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 311], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 311  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 311], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 312]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 312 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 312], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 312  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 312], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 312 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (449) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (312)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 313]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 313 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 313], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 313  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 313], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 13ms (Views: 1.4ms | ActiveRecord: 1.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 313 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 314]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 314 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 314], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 314  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 314], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.3ms | ActiveRecord: 0.5ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 314 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (453) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (314)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 315]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 315 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 315], ["created_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00], ["name", "Test product-33"], ["price", 500.0], ["slug", "test-product-33"], ["updated_at", Mon, 25 Aug 2014 05:12:11 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 315  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"455"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "455"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 455 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 100], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 455], ["item_type", "PowerShop::Product"], ["owner_id", 100], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 167ms (ActiveRecord: 3.9ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 100], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 316]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 316 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 316], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-34"], ["price", 500.0], ["slug", "test-product-34"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 316  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"456"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "456"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 456 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 101], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 456], ["item_type", "PowerShop::Product"], ["owner_id", 101], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 317]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 317 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 317], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-35"], ["price", 500.0], ["slug", "test-product-35"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 317  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"457"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "457"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 457 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 457], ["item_type", "PowerShop::Product"], ["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (1.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 318]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 318 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 318], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-36"], ["price", 500.0], ["slug", "test-product-36"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 318  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"458"} PowerShop::Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "458"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 458 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"]]  (0.6ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 458], ["item_type", "PowerShop::Product"], ["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 2.4ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 319]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 319 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 319], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-37"], ["price", 500.0], ["slug", "test-product-37"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 319  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"459"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "459"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 459 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 459], ["item_type", "PowerShop::Product"], ["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.3ms | ActiveRecord: 1.9ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 320]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 320 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 320], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-38"], ["price", 500.0], ["slug", "test-product-38"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 320  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"460"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "460"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 460 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 460], ["item_type", "PowerShop::Product"], ["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 16ms (Views: 0.1ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 321]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 321 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 321], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-39"], ["price", 500.0], ["slug", "test-product-39"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 321  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"461"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "461"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 461 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 461], ["item_type", "PowerShop::Product"], ["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 8ms (Views: 0.1ms | ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 107 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 322]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 322 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 322], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 322  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 322]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 323]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 323 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 323], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 323  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 463 [["active", false], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 323  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 323]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 324]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 324 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 324], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 324  (0.3ms) RELEASE SAVEPOINT active_record_1 Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 324]] Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 324]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 464], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 464]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 324  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 324]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 325]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 325 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 325], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 325]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 326]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 326 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 326], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 466 [["active", true], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 326  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 326]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 327]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 327 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 327], ["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 467], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 467]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 327]]  (0.0ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Mon, 25 Aug 2014 05:12:12 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 328]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 328 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 328], ["created_at", Mon, 25 Aug 2014 05:12:13 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Mon, 25 Aug 2014 05:12:13 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 328  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 328]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 328]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 328) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 328]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 328]] ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 468], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 468]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 328 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 328 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 328], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 328]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 328]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (93.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (65.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (52.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (224.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:40:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:40:59 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 329]] SQL (153.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 329 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (22.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (116.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 329], ["created_at", Tue, 26 Aug 2014 04:41:00 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Tue, 26 Aug 2014 04:41:00 UTC +00:00]] SQL (30.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 329  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"469"} PowerShop::Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "469"]] PowerShop::ShoppingCartItem Load (12.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 469 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (73.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 469], ["item_type", "PowerShop::Product"], ["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 416ms (ActiveRecord: 101.1ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 330]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 330 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 330], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 330  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"470"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "470"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 470 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 109], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 470], ["item_type", "PowerShop::Product"], ["owner_id", 109], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 331]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 331 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 331], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 331  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"471"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "471"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 471 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 110], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 471], ["item_type", "PowerShop::Product"], ["owner_id", 110], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (2.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 110], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 332]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 332 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 332], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 332  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"472"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "472"]] PowerShop::ShoppingCartItem Load (1.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 472 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 111], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 472], ["item_type", "PowerShop::Product"], ["owner_id", 111], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 111], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 333]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 333 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 333], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 333  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"473"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "473"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 473 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 473], ["item_type", "PowerShop::Product"], ["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (1.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 18ms (Views: 0.2ms | ActiveRecord: 3.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 334]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 334 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 334], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 334  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"474"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "474"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 474 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 474], ["item_type", "PowerShop::Product"], ["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.3ms | ActiveRecord: 2.1ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 335]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 335 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 335], ["created_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Tue, 26 Aug 2014 04:41:01 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 335  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"475"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "475"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 475 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 475], ["item_type", "PowerShop::Product"], ["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.4ms | ActiveRecord: 2.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (23.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 336]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 336 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 336], ["created_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 336  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"476"} PowerShop::Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "476"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 476 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 476], ["item_type", "PowerShop::Product"], ["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 205ms (ActiveRecord: 4.0ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 337]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 337 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 337], ["created_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Tue, 26 Aug 2014 04:41:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 337  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"477"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "477"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 477 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 116], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 477], ["item_type", "PowerShop::Product"], ["owner_id", 116], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 338]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 338 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 338], ["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 338  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"478"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "478"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 478 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 478], ["item_type", "PowerShop::Product"], ["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 339]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 339 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 339], ["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 339  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"479"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "479"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 479 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 479], ["item_type", "PowerShop::Product"], ["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 340]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 340 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 340], ["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 340  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"480"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "480"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 480 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 480], ["item_type", "PowerShop::Product"], ["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.1ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 341]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 341 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 341], ["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 341  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"481"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "481"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 481 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 481], ["item_type", "PowerShop::Product"], ["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 342]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 342 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 342], ["created_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Tue, 26 Aug 2014 04:41:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 342  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"482"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "482"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 482 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 121], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 482], ["item_type", "PowerShop::Product"], ["owner_id", 121], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 121], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by PowerShop::CartController#show as HTML Completed 500 Internal Server Error in 307ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 343]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 343 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 343], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 343  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"483"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "483"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 483 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 122], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 483], ["item_type", "PowerShop::Product"], ["owner_id", 122], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 182ms (ActiveRecord: 4.2ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 344]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 344 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 344], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 344  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"484"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "484"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 484 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 123], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 484], ["item_type", "PowerShop::Product"], ["owner_id", 123], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 123], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 345]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 345 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 345], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 345  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"485"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "485"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 485 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 485], ["item_type", "PowerShop::Product"], ["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.1ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 346]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 346 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 346], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 346  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"486"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "486"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 486 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 486], ["item_type", "PowerShop::Product"], ["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 2.1ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 347]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 347 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 347], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 347  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"487"} PowerShop::Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "487"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 487 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"]]  (0.9ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 487], ["item_type", "PowerShop::Product"], ["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 18ms (Views: 0.1ms | ActiveRecord: 4.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 348]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 348 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 348], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 348  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"488"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "488"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 488 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 488], ["item_type", "PowerShop::Product"], ["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.4ms | ActiveRecord: 2.2ms)  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 349]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 349 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 349], ["created_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Tue, 26 Aug 2014 04:43:13 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 349  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"489"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "489"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 489 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 489], ["item_type", "PowerShop::Product"], ["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.3ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.4ms) BEGIN Processing by PowerShop::CartController#show as HTML Completed 200 OK in 145ms (Views: 144.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.5ms) Completed 200 OK in 154ms (Views: 153.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 350]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 350 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 350], ["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 350  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"490"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "490"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 490 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 131], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 490], ["item_type", "PowerShop::Product"], ["owner_id", 131], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 131], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 166ms (Views: 0.1ms | ActiveRecord: 4.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 351]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 351 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 351], ["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 351  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"491"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "491"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 491 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 491], ["item_type", "PowerShop::Product"], ["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (1.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.7ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 352]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 352 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 352], ["created_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Tue, 26 Aug 2014 04:45:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 352  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"492"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "492"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 492 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 492], ["item_type", "PowerShop::Product"], ["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 1.9ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 353]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 353 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 353], ["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 353  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"493"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "493"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 493 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 134], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 493], ["item_type", "PowerShop::Product"], ["owner_id", 134], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.5ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 134], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 354]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 354 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 354], ["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 354  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"494"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "494"]] PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 494 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 135], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 494], ["item_type", "PowerShop::Product"], ["owner_id", 135], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 355]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 355 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 355], ["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 355  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"495"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "495"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 495 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 136], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 495], ["item_type", "PowerShop::Product"], ["owner_id", 136], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.5ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 136], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 356]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 356 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 356], ["created_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Tue, 26 Aug 2014 04:45:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 356  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"496"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "496"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 496 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 137], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 496], ["item_type", "PowerShop::Product"], ["owner_id", 137], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 137], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.3ms) Completed 200 OK in 145ms (Views: 144.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 357]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 357 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 357], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 357  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"497"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "497"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 497 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 140], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 497], ["item_type", "PowerShop::Product"], ["owner_id", 140], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 140], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 168ms (Views: 0.1ms | ActiveRecord: 4.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 358]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 358 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 358], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 358  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"498"} PowerShop::Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "498"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 498 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 141], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 498], ["item_type", "PowerShop::Product"], ["owner_id", 141], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 141], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.1ms | ActiveRecord: 2.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 359]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 359 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 359], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 359  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"499"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "499"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 499 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 142], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 499], ["item_type", "PowerShop::Product"], ["owner_id", 142], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 142], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 360]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 360 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 360], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 360  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"500"} PowerShop::Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "500"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 500 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 143], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 500], ["item_type", "PowerShop::Product"], ["owner_id", 143], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 2.0ms) PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 143], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 361]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 361 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 361], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 361  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"501"} PowerShop::Product Load (1.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "501"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 501 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 144], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 501], ["item_type", "PowerShop::Product"], ["owner_id", 144], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 3.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 362]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 362 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 362], ["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 362  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"502"} PowerShop::Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "502"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 502 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 145], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 502], ["item_type", "PowerShop::Product"], ["owner_id", 145], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.8ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 145], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Tue, 26 Aug 2014 04:45:58 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 363]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 363 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 363], ["created_at", Tue, 26 Aug 2014 04:45:59 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Tue, 26 Aug 2014 04:45:59 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 363  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"503"} PowerShop::Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "503"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'PowerShop::Product' AND "shopping_cart_items"."item_id" = 503 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 146], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 503], ["item_type", "PowerShop::Product"], ["owner_id", 146], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 146], ["owner_type", "PowerShop::ShoppingCart"]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (41.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (76.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:51 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:51 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 364]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 364 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (32.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (35.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 364], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 364  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 364]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 364]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 364) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 364]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 364]] ShopImage Load (15.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 504], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 504]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 364 SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 364 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 364], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 364]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 364]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 365]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 365 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 365], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 505], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 505]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 365]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 366]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 366 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 366], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 506 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 366  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 366]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 367]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 367 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 367], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 367]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 368]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 368 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 368], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 368  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 368]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 368]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 508], ["subject_type", "Product"]] SQL (0.9ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 508]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 368  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 368]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 369]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 369 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 369], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 369  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 509 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 369  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 369]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 370]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 370 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 370], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 370  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 370]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (41.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.3ms) Completed 200 OK in 179ms (Views: 178.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 371]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 371 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 371], ["created_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:44:52 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 371  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"511"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "511"]] PowerShop::ShoppingCartItem Load (16.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 511 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 149], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (33.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 511], ["item_type", "Product"], ["owner_id", 149], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 149], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 160ms (Views: 0.1ms | ActiveRecord: 53.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 372]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 372 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 372], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 372  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"512"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "512"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 512 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 150], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 512], ["item_type", "Product"], ["owner_id", 150], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 150], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 16ms (Views: 0.3ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 373]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 373 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 373], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-10"], ["price", 500.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 373  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"513"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "513"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 513 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 151], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 513], ["item_type", "Product"], ["owner_id", 151], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 151], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.2ms | ActiveRecord: 2.5ms)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 374]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 374 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 374], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-11"], ["price", 500.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 374  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"514"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "514"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 514 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 152], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 514], ["item_type", "Product"], ["owner_id", 152], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 152], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 375]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 375 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 375], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-12"], ["price", 500.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 375  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"515"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "515"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 515 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 153], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 515], ["item_type", "Product"], ["owner_id", 153], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 2.3ms)  (0.6ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 153], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 376]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 376 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 376], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-13"], ["price", 500.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 376  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"516"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "516"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 516 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 154], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 516], ["item_type", "Product"], ["owner_id", 154], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (1.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 154], ["owner_type", "PowerShop::ShoppingCart"]]  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 377]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 377 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 377], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-14"], ["price", 500.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 377  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"517"} Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "517"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 517 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 155], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 517], ["item_type", "Product"], ["owner_id", 155], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 378]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 378 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 378], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 378  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 378], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 120ms (Views: 114.5ms | ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 379]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 379 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 379], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 379  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 379], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.7ms | ActiveRecord: 0.9ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 380]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 380 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 380], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 380  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 380], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.3ms | ActiveRecord: 1.1ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 380 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (522) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (380)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 381]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 381 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 381], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 381  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 381], ["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.7ms)  (0.7ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 381 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:53 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 382]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 382 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 382], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 382  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 382], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 1.2ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 382 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (526) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (382)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 383]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 383 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 383], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 383  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 383], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 383]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-92c3a699-191c-4e1f-a3bb-da54c579e66a"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 384]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 384 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 384], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 384  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-27", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-27' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (530) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (384) Completed 200 OK in 74ms (Views: 65.1ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 385]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 385 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 385], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 385  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 385], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 385]] SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-fa4c45ae-54e3-40d2-b8fd-a1d474619327"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 386]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 386 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 386], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 386  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-30", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-30' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (533) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (386) Completed 200 OK in 14ms (Views: 1.5ms | ActiveRecord: 2.0ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 387]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 387 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 387], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 387  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 387], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 387]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-96d966b4-1f58-4fb0-8bb5-ed775bc42724"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 388]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 388 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 388], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 389]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 389 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 389], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 389  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 389], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 389]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3040f09c-992b-4a9a-a41c-80a5fb8e8669"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 390]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 390 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 390], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 390  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 391]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 391 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 391], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 391  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 391], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 80ms (Views: 79.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 392]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 392 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 392], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 392  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 392], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 393]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 393 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 393], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 393  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 393], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (544) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (393)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 394]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 394 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 394], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.8ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 394  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 394], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (546) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (394)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 395]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 395 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 395], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 395  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 395], ["created_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:44:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.8ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.5ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 156 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN PG::UndefinedTable: ERROR: relation "orders" does not exist LINE 5: WHERE a.attrelid = '"orders"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"orders"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.1ms) ROLLBACK  (0.1ms) BEGIN PG::UndefinedTable: ERROR: relation "orders" does not exist LINE 5: WHERE a.attrelid = '"orders"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"orders"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.1ms) ROLLBACK  (0.1ms) BEGIN PG::UndefinedTable: ERROR: relation "orders" does not exist LINE 5: WHERE a.attrelid = '"orders"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"orders"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.1ms) ROLLBACK  (162.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (1912.6ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (35.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (2.4ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.8ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.8ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.2ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.3ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)   (2.1ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.8ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)   (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateOrders (20140828061402)  (0.2ms) BEGIN  (4.1ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140828061402"]]  (0.6ms) COMMIT Migrating to CreateOrderItems (20140828061556)  (0.2ms) BEGIN  (3.3ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)   (1.9ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" ("order_id") SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140828061556"]]  (0.8ms) COMMIT ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (21.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:32 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:32 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:45:32 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:45:32 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (1.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 3], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 6], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 6]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 7 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.5ms) Completed 200 OK in 497ms (Views: 496.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:45:33 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"8"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "8"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 8 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 8], ["item_type", "Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 62ms (Views: 0.2ms | ActiveRecord: 4.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"9"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "9"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 9 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 9], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-10"], ["price", 500.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"10"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "10"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 10 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 10], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.0ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-11"], ["price", 500.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"11"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "11"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 11 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 11], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-12"], ["price", 500.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"12"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "12"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 12 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 12], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-13"], ["price", 500.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"13"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "13"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 13 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 13], ["item_type", "Product"], ["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (4.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-14"], ["price", 500.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"14"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "14"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 14 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 14], ["item_type", "Product"], ["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.2ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 111ms (Views: 109.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (19)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 60ms (Views: 56.2ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 21 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (27) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 4ms (Views: 1.1ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 22 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (22)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:45:34 UTC +00:00]] SQL (0.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 24 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 25]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-6e7b0ea9-5b9d-4510-acf0-f3e8d6881707"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 27]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-481f94f9-b028-48c7-851b-9364de8df61b"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-40", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-40' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (1.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (40) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (28) Completed 200 OK in 77ms (Views: 62.4ms | ActiveRecord: 2.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 29  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 29]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3cf7320f-f8a0-4cd8-8df7-246ae9b6f254"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-43", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-43' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (43) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (30) Completed 200 OK in 10ms (Views: 1.1ms | ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 31  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 31]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-1b67f099-39f4-46ed-b498-85ce69f5b62d"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:45:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 10 LIMIT 1  (0.1ms) ROLLBACK  (107.0ms) DROP DATABASE IF EXISTS "power_shop_test"  (308.3ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (8.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.6ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.9ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (2.8ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)  (1.8ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" USING btree ("order_id")  (3.9ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (4.2ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (1.3ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (5.0ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061556')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061402') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 194ms (Views: 192.3ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (1) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.8ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (1.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0b4bddc3-9290-4ea2-9dc3-ca7194ef8d40"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-4232bd35-cb62-4bf1-8440-744484f690c6"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-3df15e00-e188-448e-9b97-08d21bfddedc"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:46:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 70ms (Views: 59.0ms | ActiveRecord: 1.8ms)  (0.3ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-facdec75-5361-4abd-83d7-aa14539364b7"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 12ms (Views: 1.2ms | ActiveRecord: 1.9ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 68ms (Views: 62.2ms | ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 15 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.7ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (3.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 2.2ms | ActiveRecord: 0.4ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (31) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.3ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-33"], ["price", 500.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "33"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 33 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 33], ["item_type", "Product"], ["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 104ms (ActiveRecord: 3.7ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-34"], ["price", 500.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"34"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "34"]] PowerShop::ShoppingCartItem Load (1.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 34 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 34], ["item_type", "Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 3.0ms) PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-35"], ["price", 500.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"35"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "35"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 35 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 35], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-36"], ["price", 500.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"36"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "36"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 36 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 36], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 2.0ms) PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["name", "Test product-37"], ["price", 500.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"37"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "37"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 37 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 37], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.2ms | ActiveRecord: 2.3ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-38"], ["price", 500.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"38"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "38"]] PowerShop::ShoppingCartItem Load (1.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 38 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 38], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.8ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-39"], ["price", 500.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"39"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "39"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 39 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 39], ["item_type", "Product"], ["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 2.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 64ms (Views: 63.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 41 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 42], ["subject_type", "Product"]] SQL (0.5ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 42]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 28  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.6ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 44 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 45], ["subject_type", "Product"]] SQL (1.6ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 45]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:46:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 32]] SQL (0.6ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 32) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 46], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 46]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 ShopImage Load (0.8ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 32], ["subject_type", "Category"]] SQL (0.6ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 32]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (510.2ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.0ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.5ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (3.2ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (3.3ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (3.5ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (2.0ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.7ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.5ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (2.7ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)  (1.6ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" USING btree ("order_id")  (4.0ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (4.4ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.7ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.8ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.2ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.7ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061556')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061402') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (24.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:40 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-11bd3d59-b458-47eb-85c3-ecc0f4cd80ad"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 3]] SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-56652972-04ff-4304-94a0-62b4688bf163"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.3ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e715b0f0-c39c-4877-a087-f4affa50afff"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-9", "category_id"=>"test-category"} Category Load (1.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-9' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (9) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (6) Completed 200 OK in 283ms (Views: 187.9ms | ActiveRecord: 3.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]] SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-467ae3ff-976c-4da8-b6d1-1127d822de03"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-12", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-12' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (12) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8) Completed 200 OK in 12ms (Views: 1.4ms | ActiveRecord: 1.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 65ms (Views: 63.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (15) Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (10)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (17) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.1ms) ROLLBACK  (1.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Product Exists (2.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:46:41 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 64.3ms | ActiveRecord: 1.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 14 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (23) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (14)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.7ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 10ms (Views: 1.1ms | ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 17 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (29) Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 1.1ms)  (0.6ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-33"], ["price", 500.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "33"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 33 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 1], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 33], ["item_type", "Product"], ["owner_id", 1], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 108ms (ActiveRecord: 4.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-34"], ["price", 500.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"34"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "34"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 34 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 34], ["item_type", "Product"], ["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.9ms)  (0.9ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-35"], ["price", 500.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"35"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "35"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 35 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 35], ["item_type", "Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-36"], ["price", 500.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"36"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "36"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 36 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 36], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-37"], ["price", 500.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"37"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "37"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 37 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 37], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.2ms | ActiveRecord: 2.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-38"], ["price", 500.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"38"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "38"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 38 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 38], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.1ms | ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00], ["name", "Test product-39"], ["price", 500.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:46:42 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"39"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "39"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 39 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 39], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 2.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 61ms (Views: 60.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 40 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 26  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 42], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 42]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 43 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 29  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (1.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 45], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 45]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:46:43 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 32]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 32) SQL (0.7ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.8ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]] ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 46], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 46]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 32], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 32]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.2ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.3ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 10 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (106.6ms) DROP DATABASE IF EXISTS "power_shop_test"  (283.8ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.7ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (4.4ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (2.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)  (1.6ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" USING btree ("order_id")  (4.1ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (3.8ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.9ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.9ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (1.6ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.1ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (5.1ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061556')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061402') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (21.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]] SQL (0.4ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 1) SQL (0.5ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.4ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 1], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 1]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 1], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 2], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 4 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 5], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 5]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 7 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]]  (1.0ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Rendered /vagrant/power_shop/app/views/power_shop/catalog/category.html.erb within layouts/application (0.4ms) Completed 200 OK in 216ms (Views: 211.9ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:48:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 10 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.1ms | ActiveRecord: 0.7ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14) Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 67ms (Views: 66.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 7ms (Views: 5.8ms | ActiveRecord: 0.0ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 18]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e3f4934e-9b9f-4fe5-89d0-81d3969ae2fc"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-30", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-30' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (19) Completed 200 OK in 62ms (Views: 53.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0e906c0a-817b-41ec-8640-0b7faba43ef8"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-33", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-33' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21) Completed 200 OK in 12ms (Views: 1.2ms | ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 22]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a93f992f-8a01-48e9-b821-3532935cea5b"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-708e90f4-8038-4277-ba1c-cd9a502ad0d4"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:48:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.5ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 1 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (1.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 59ms (Views: 58.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-40"], ["price", 500.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"40"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "40"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 40 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 40], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 78ms (Views: 0.2ms | ActiveRecord: 4.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-41"], ["price", 500.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"41"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "41"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 41 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 41], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-42"], ["price", 500.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"42"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "42"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 42 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 42], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-43"], ["price", 500.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 29  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"43"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "43"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 43 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 43], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-44"], ["price", 500.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"44"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "44"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 44 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 44], ["item_type", "Product"], ["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.8ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-45"], ["price", 500.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 31  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"45"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "45"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 45 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 45], ["item_type", "Product"], ["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00], ["name", "Test product-46"], ["price", 500.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:48:22 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"46"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "46"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 46 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 46], ["item_type", "Product"], ["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 10], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (107.7ms) DROP DATABASE IF EXISTS "power_shop_test"  (277.1ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (8.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.1ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.9ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (1.6ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.9ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (5.2ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.8ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.9ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.8ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (1.7ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (2.7ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)  (1.6ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" USING btree ("order_id")  (4.0ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (4.2ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (2.2ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.7ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (1.7ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (4.3ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.6ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061556')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061402') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.4ms) Completed 200 OK in 165ms (Views: 164.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (23.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:35 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:35 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:50:35 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:50:35 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"1"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "1"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 1 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 1], ["item_type", "Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 179ms (Views: 0.2ms | ActiveRecord: 4.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"2"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "2"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 2], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 16ms (Views: 0.2ms | ActiveRecord: 3.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"3"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "3"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 3 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 3], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 2.5ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"4"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "4"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 4 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 4], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"5"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "5"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 5 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 5], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 15ms (ActiveRecord: 1.9ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"6"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "6"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 6 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 6], ["item_type", "Product"], ["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 2.0ms)  (0.8ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 8], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"7"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "7"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 7 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 7], ["item_type", "Product"], ["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.0ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 9], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 113ms (Views: 107.6ms | ActiveRecord: 0.5ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 8 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (1.1ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (8) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (8)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 9  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (2.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 9ms (Views: 1.3ms | ActiveRecord: 2.1ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (1.2ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:50:36 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 2.0ms | ActiveRecord: 0.5ms) Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 11 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (14) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 12 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 76ms (Views: 74.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 68ms (Views: 65.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms) Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (24) Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (16)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (26) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (17)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 18]] SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-05004943-e85a-4159-a1a3-3bc3bc3758ed"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (2.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-30", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-30' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (30) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (19) Completed 200 OK in 84ms (Views: 71.1ms | ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-8ea6cea2-a92f-4d15-925a-8e458f7eddce"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-33", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-33' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (33) Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (21) Completed 200 OK in 13ms (Views: 1.5ms | ActiveRecord: 2.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 22]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0bf8da4c-cb1b-4931-95bc-067bfd0e7e19"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-c5afa4ba-77ad-48e0-8279-f255615bc77f"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (2.2ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:50:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 40], ["subject_type", "Product"]] SQL (0.8ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 40]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]]  (0.8ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 42 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 29  (0.4ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 43], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 43]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 29  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 31  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 45 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 31  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:50:38 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 32]] SQL (0.5ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 32) SQL (0.9ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 46], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 46]] SQL (0.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 32], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 32]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 10 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (107.8ms) DROP DATABASE IF EXISTS "power_shop_test"  (268.4ms) CREATE DATABASE "power_shop_test" ENCODING = 'utf8' SQL (7.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (10.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255) NOT NULL, "slug" character varying(255), "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer, "description" text, "created_at" timestamp, "updated_at" timestamp, "products_count" integer DEFAULT 0)  (1.7ms) CREATE INDEX "index_categories_on_lft" ON "categories" USING btree ("lft")  (1.7ms) CREATE INDEX "index_categories_on_parent_id" ON "categories" USING btree ("parent_id")  (2.2ms) CREATE INDEX "index_categories_on_rgt" ON "categories" USING btree ("rgt")  (1.4ms) CREATE UNIQUE INDEX "index_categories_on_slug" ON "categories" USING btree ("slug")  (3.9ms) CREATE TABLE "friendly_id_slugs" ("id" serial primary key, "slug" character varying(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" character varying(50), "scope" character varying(255), "created_at" timestamp)   (1.5ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type", "scope")  (1.6ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" USING btree ("slug", "sluggable_type")  (1.4ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" USING btree ("sluggable_id")  (2.0ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" USING btree ("sluggable_type")  (3.5ms) CREATE TABLE "order_items" ("id" serial primary key, "order_id" integer NOT NULL, "product_id" integer, "product_title" character varying(255) NOT NULL, "price" float NOT NULL)  (1.8ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" USING btree ("order_id")  (3.8ms) CREATE TABLE "orders" ("id" serial primary key, "user_name" character varying(255), "user_phone" character varying(255), "user_email" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (4.3ms) CREATE TABLE "products" ("id" serial primary key, "category_id" integer NOT NULL, "active" boolean DEFAULT 't', "name" character varying(255) NOT NULL, "slug" character varying(255), "image" character varying(255), "description" text, "price" float NOT NULL, "sort" integer DEFAULT 500, "created_at" timestamp, "updated_at" timestamp)   (1.5ms) CREATE INDEX "index_products_on_category_id" ON "products" USING btree ("category_id")  (1.6ms) CREATE UNIQUE INDEX "index_products_on_slug" ON "products" USING btree ("slug")  (3.5ms) CREATE TABLE "shop_images" ("id" serial primary key, "subject_id" integer NOT NULL, "subject_type" character varying(255) NOT NULL, "image" character varying(255), "created_at" timestamp, "updated_at" timestamp)  (1.8ms) CREATE INDEX "index_shop_images_on_subject_id" ON "shop_images" USING btree ("subject_id")  (3.7ms) CREATE TABLE "shopping_cart_items" ("id" serial primary key, "owner_id" integer, "owner_type" character varying(255), "quantity" integer, "item_id" integer, "item_type" character varying(255), "price" float)  (2.9ms) CREATE TABLE "shopping_carts" ("id" serial primary key)   (1.1ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061556')  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140723131458')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140728071046')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140729041407')  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140731171009')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140804101936')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140828061402') ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (26.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]] Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 1 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["name", "Test product-1"], ["price", 1000.0], ["slug", "test-product-1"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 1], ["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["name", "Test product-2"], ["price", 1000.0], ["slug", "test-product-2"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Rendered /vagrant/power_shop/app/views/power_shop/catalog/index.html.erb within layouts/application (0.4ms) Completed 200 OK in 206ms (Views: 204.5ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 2]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 2 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["name", "Test product-3"], ["price", 1000.0], ["slug", "test-product-3"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 2], ["created_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00], ["name", "Test product-4"], ["price", 1000.0], ["slug", "test-product-4"], ["updated_at", Thu, 28 Aug 2014 06:51:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) Product Load (1.8ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (3) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 3]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 3 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-5"], ["price", 1000.0], ["slug", "test-product-5"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 3  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 3], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-6"], ["price", 1000.0], ["slug", "test-product-6"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.9ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 4]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 4 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-7"], ["price", 1000.0], ["slug", "test-product-7"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 4  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 4], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (7) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 5]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 5 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 5  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 5], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 6]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 6 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 6  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 6], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 6]] SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-819243ff-fd66-404c-b398-f9e7ed5b01a9"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 7]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 7 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.0ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 7], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 7  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 8]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 8 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 8  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 8], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 8]] SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-0bb3428a-7372-4f60-b1f1-173ab79989ce"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 9]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 9 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 9], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 10]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 10 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 10  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 10], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-ceac1484-9842-456e-b112-b00c56ad8f8b"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 11]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 11 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 11], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 11  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-19", "category_id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-19' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (19) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (11) Completed 200 OK in 74ms (Views: 64.7ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 12]] SQL (0.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 12 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 12  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 12], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 12]] SQL (1.0ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-a8a68e30-c2a0-4788-b3b7-8ac60c380e4f"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 13]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 13 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 13], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 13  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-22", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-22' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (22) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (13) Completed 200 OK in 14ms (Views: 1.7ms | ActiveRecord: 2.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Category Exists (2.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 14]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 14 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 14  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 14], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 71ms (Views: 65.8ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 15]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 15 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 15  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 15], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.6ms | ActiveRecord: 0.6ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 15 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (25) Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (15)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 16]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 16 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 16  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 16], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 5ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 16 LIMIT 25 OFFSET 0) subquery_for_count  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 17]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 17 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 17  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 17], ["created_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Thu, 28 Aug 2014 06:51:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.5ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 18]] SQL (2.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 18 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 18  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 18], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 6ms (Views: 1.2ms | ActiveRecord: 0.5ms) Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 18 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.7ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (31) Category Load (1.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 19]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 19 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 19], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-33"], ["price", 500.0], ["slug", "test-product-33"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 19  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"33"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "33"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 33 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 1], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 33], ["item_type", "Product"], ["owner_id", 1], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 92ms (ActiveRecord: 3.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 20]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 20 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 20], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-34"], ["price", 500.0], ["slug", "test-product-34"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 20  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"34"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "34"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 34 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 34], ["item_type", "Product"], ["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 2.2ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 2], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 21]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 21 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 21], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-35"], ["price", 500.0], ["slug", "test-product-35"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 21  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"35"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "35"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 35 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 35], ["item_type", "Product"], ["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 2.9ms) PowerShop::ShoppingCartItem Load (2.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 3], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 22]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 22 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 22], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-36"], ["price", 500.0], ["slug", "test-product-36"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 22  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"36"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "36"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 36 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.5ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 36], ["item_type", "Product"], ["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 2.0ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 4], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 23]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 23 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 23], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-37"], ["price", 500.0], ["slug", "test-product-37"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 23  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"37"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "37"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 37 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 37], ["item_type", "Product"], ["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 5], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 24]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 24 ORDER BY "categories"."lft")  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 24], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-38"], ["price", 500.0], ["slug", "test-product-38"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 24  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"38"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "38"]] PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 38 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 38], ["item_type", "Product"], ["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 6], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 25]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 25 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 25], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-39"], ["price", 500.0], ["slug", "test-product-39"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 25  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"39"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "39"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 39 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 39], ["item_type", "Product"], ["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 7], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 60ms (Views: 60.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 10 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 26 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 26], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 26  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 26]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 27 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 27], ["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 27  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 41 [["active", false], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 27  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 27]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:05 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 28 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 28], ["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 28  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.2ms) SAVEPOINT active_record_1 ShopImage Load (1.0ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 42], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 42]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 28  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 28]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 29 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 29], ["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 29]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 30 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 30], ["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 44 [["active", true], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 30  (0.2ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 30]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 31 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 31], ["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 45], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 45]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 31]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 32 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 32], ["created_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Thu, 28 Aug 2014 06:51:06 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 32  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.1ms) SAVEPOINT active_record_1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 32]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 32) SQL (0.9ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.7ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 32]] Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]] ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 46], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 46]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 32 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 32], ["subject_type", "Category"]] SQL (0.3ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 32]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 32]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (29.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (19.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (51.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (97.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 33]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 33 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (64.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (47.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 33], ["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 33  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"47"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "47"]] PowerShop::ShoppingCartItem Load (18.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 47 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 11], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (21.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 47], ["item_type", "Product"], ["owner_id", 11], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 219ms (ActiveRecord: 42.1ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 11], ["owner_type", "PowerShop::ShoppingCart"]]  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 34]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 34 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 34], ["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 34  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"48"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "48"]] PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 48 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 12], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 48], ["item_type", "Product"], ["owner_id", 12], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 35]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 35 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 35], ["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 35  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"49"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "49"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 49 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 49], ["item_type", "Product"], ["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 13], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 36]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 36 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 36], ["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 36  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"50"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "50"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 50 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 14], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 50], ["item_type", "Product"], ["owner_id", 14], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 14], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 37]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 37 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 37], ["created_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 11:11:52 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 37  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"51"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "51"]] PowerShop::ShoppingCartItem Load (1.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 51 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 15], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 51], ["item_type", "Product"], ["owner_id", 15], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (3.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 15], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 35ms (Views: 0.2ms | ActiveRecord: 5.5ms)  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (7.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 38]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 38 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 38], ["created_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 38  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"52"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "52"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 52 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 16], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 52], ["item_type", "Product"], ["owner_id", 16], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 16], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.2ms | ActiveRecord: 1.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.3ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:53 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 39]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 39 ORDER BY "categories"."lft")  (3.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (4.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 39], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] SQL (2.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 39  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"53"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "53"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 53 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 17], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 53], ["item_type", "Product"], ["owner_id", 17], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 17], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 194ms (Views: 193.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 40]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 40 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 40], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-8"], ["price", 1000.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 40  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 40], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-9"], ["price", 1000.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 110ms (Views: 109.3ms | ActiveRecord: 0.0ms) Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (12.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (54) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (40)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 41]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 41 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 41], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-10"], ["price", 1000.0], ["slug", "test-product-10"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 41  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-11' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 41], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-11"], ["price", 1000.0], ["slug", "test-product-11"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 42]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 42 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-12' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 42], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-12"], ["price", 1000.0], ["slug", "test-product-12"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 42  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-13' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 42], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-13"], ["price", 1000.0], ["slug", "test-product-13"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 54ms (Views: 52.0ms | ActiveRecord: 0.0ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (58) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (42)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 43]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 43 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-14' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 43], ["created_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00], ["name", "Test product-14"], ["price", 1000.0], ["slug", "test-product-14"], ["updated_at", Sun, 31 Aug 2014 11:11:55 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 43  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-15' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 43], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-15"], ["price", 1000.0], ["slug", "test-product-15"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.5ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 44]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 44 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-16' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 44], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-16"], ["price", 1000.0], ["slug", "test-product-16"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 44  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-17' LIMIT 1 SQL (2.4ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 44], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-17"], ["price", 1000.0], ["slug", "test-product-17"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#index as HTML Parameters: {"page"=>"2"} Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 45]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 45 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-18' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 45], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-18"], ["price", 1000.0], ["slug", "test-product-18"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 45  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-19' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 45], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-19"], ["price", 1000.0], ["slug", "test-product-19"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 45]] SQL (2.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-5d4ab6dd-dc1d-4513-b2dc-29140fa3b830"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 46]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 46 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-20' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 46], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-20"], ["price", 1000.0], ["slug", "test-product-20"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 46  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 47]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 47 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-21' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 47], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-21"], ["price", 1000.0], ["slug", "test-product-21"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 47  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-22' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 47], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-22"], ["price", 1000.0], ["slug", "test-product-22"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 47]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-64c5fb96-45a2-491d-8c2a-dd59a31cd767"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 48]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 48 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-23' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 48], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-23"], ["price", 1000.0], ["slug", "test-product-23"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 49]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 49 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.3ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-24' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 49], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-24"], ["price", 1000.0], ["slug", "test-product-24"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 49  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-25' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 49], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-25"], ["price", 1000.0], ["slug", "test-product-25"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 49]] SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-e53736c7-17dc-4fc7-b0ed-6b785ae99f7c"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 50]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 50 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-26' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 50], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-26"], ["price", 1000.0], ["slug", "test-product-26"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 50  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-26", "category_id"=>"test-category"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (1.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-26' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (72) Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (50) Completed 200 OK in 72ms (Views: 56.2ms | ActiveRecord: 3.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 51]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 51 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-27' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 51], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-27"], ["price", 1000.0], ["slug", "test-product-27"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 51  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-28' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 51], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-28"], ["price", 1000.0], ["slug", "test-product-28"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (2.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 51]] SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 3], ["name", "Test category"], ["rgt", 4], ["slug", "test-category-b60bfec8-fe7a-417f-8bd5-8aa69dc90e63"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 52]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 52 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-29' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 52], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-29"], ["price", 1000.0], ["slug", "test-product-29"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 52  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#product as HTML Parameters: {"id"=>"test-product-29", "category_id"=>"test-category"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."slug" = 'test-product-29' ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 1 ShopImage Load (0.4ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (75) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (52) Completed 200 OK in 18ms (Views: 2.8ms | ActiveRecord: 2.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 53]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 53 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-30' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 53], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-30"], ["price", 1000.0], ["slug", "test-product-30"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 53  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-31' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 53], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-31"], ["price", 1000.0], ["slug", "test-product-31"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 69ms (Views: 63.3ms | ActiveRecord: 0.5ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 53 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (76) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (53)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 54]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 54 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-32' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 54], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-32"], ["price", 1000.0], ["slug", "test-product-32"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 54  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-33' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 54], ["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["name", "Test product-33"], ["price", 1000.0], ["slug", "test-product-33"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 55]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 55 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-34' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 55], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-34"], ["price", 1000.0], ["slug", "test-product-34"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 55  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-35' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 55], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-35"], ["price", 1000.0], ["slug", "test-product-35"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.2ms | ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 56]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 56 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-36' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 56], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-36"], ["price", 1000.0], ["slug", "test-product-36"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 56  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-37' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 56], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-37"], ["price", 1000.0], ["slug", "test-product-37"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 8ms (Views: 1.1ms | ActiveRecord: 0.5ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 56 ORDER BY "products"."sort" ASC, "products"."id" ASC LIMIT 25 OFFSET 0 ShopImage Load (0.3ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_type" = 'Product' AND "shop_images"."subject_id" IN (82) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (56)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (2.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 57]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 57 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.1ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-38' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 57], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-38"], ["price", 1000.0], ["slug", "test-product-38"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 57  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-39' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 57], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-39"], ["price", 1000.0], ["slug", "test-product-39"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Processing by CatalogController#category as HTML Parameters: {"id"=>"test-category"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."slug" = 'test-category' ORDER BY "categories"."id" ASC LIMIT 1 Completed 200 OK in 7ms (Views: 1.1ms | ActiveRecord: 0.5ms)  (0.4ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "products" WHERE "products"."active" = 't' AND "products"."category_id" = 57 LIMIT 25 OFFSET 0) subquery_for_count  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 58 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-40' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 58], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-40"], ["price", 1000.0], ["slug", "test-product-40"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 58  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 58]]  (0.1ms) SAVEPOINT active_record_1 Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 FOR UPDATE [["id", 58]] SQL (0.7ms) DELETE FROM "categories" WHERE ("categories"."lft" >= 1) AND ("categories"."lft" < 2) AND ("categories"."id" != 58) SQL (0.6ms) UPDATE "categories" SET "lft" = ("lft" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."lft" > 2) ORDER BY "categories"."lft") SQL (0.5ms) UPDATE "categories" SET "rgt" = ("rgt" - 2) WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE ("categories"."rgt" > 2) ORDER BY "categories"."lft") Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 58]] Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = $1 [["category_id", 58]] ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 86], ["subject_type", "Product"]] SQL (0.4ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 86]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 58 SQL (0.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 58 ShopImage Load (0.6ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 LIMIT 1 [["subject_id", 58], ["subject_type", "Category"]] SQL (0.4ms) DELETE FROM "categories" WHERE "categories"."id" = $1 [["id", 58]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "products" WHERE "products"."category_id" = $1 [["category_id", 58]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 59]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 59 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-41' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 59], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-41"], ["price", 1000.0], ["slug", "test-product-41"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 59  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 59]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 60]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 60 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-42' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 60], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-42"], ["price", 1000.0], ["slug", "test-product-42"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 60  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 88 [["active", false], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 60  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 60]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 61 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-43' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 61], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-43"], ["price", 1000.0], ["slug", "test-product-43"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 61  (0.6ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]] Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]]  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 89], ["subject_type", "Product"]] SQL (0.2ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 89]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) - 1 WHERE "categories"."id" = 61  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 61]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 62]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 62 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-44' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 62], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-44"], ["price", 1000.0], ["slug", "test-product-44"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 62]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 63]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 63 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-45' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 63], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-45"], ["price", 1000.0], ["slug", "test-product-45"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "products" SET "active" = $1, "updated_at" = $2 WHERE "products"."id" = 91 [["active", true], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 63  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 63]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.8ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 64]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 64 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-46' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("active", "category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", false], ["category_id", 64], ["created_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00], ["name", "Test product-46"], ["price", 1000.0], ["slug", "test-product-46"], ["updated_at", Sun, 31 Aug 2014 11:11:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 ShopImage Load (0.5ms) SELECT "shop_images".* FROM "shop_images" WHERE "shop_images"."subject_id" = $1 AND "shop_images"."subject_type" = $2 [["subject_id", 92], ["subject_type", "Product"]] SQL (0.3ms) DELETE FROM "products" WHERE "products"."id" = $1 [["id", 92]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 64]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) ROLLBACK  (0.1ms) BEGIN ShoppingCart Load (0.5ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" IS NULL ORDER BY "shopping_carts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 ShoppingCart Exists (0.4ms) SELECT 1 AS one FROM "shopping_carts" WHERE "shopping_carts"."id" = 20 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (15.0ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (15.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.4ms) Completed 200 OK in 139ms (Views: 138.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (67.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 65]] SQL (48.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 65 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 65], ["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] SQL (21.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 65  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"93"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "93"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 93 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 23], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 93], ["item_type", "Product"], ["owner_id", 23], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 23], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 137ms (Views: 0.2ms | ActiveRecord: 4.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 66]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 66 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 66], ["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 66  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"94"} Product Load (0.9ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "94"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 94 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 24], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 94], ["item_type", "Product"], ["owner_id", 24], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 24], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 67]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 67 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 67], ["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 67  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"95"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "95"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 95 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 25], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 95], ["item_type", "Product"], ["owner_id", 25], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 25], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 68]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 68 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 68], ["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 68  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"96", "quantity"=>"2"} Product Load (1.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "96"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 96 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 96], ["item_type", "Product"], ["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 2.3ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 26], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 69]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 69 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 69], ["created_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 12:57:30 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 69  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"97"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "97"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 97 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 97], ["item_type", "Product"], ["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms)  (0.7ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 27], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 70]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 70 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 70], ["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 70  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"98"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "98"]] PowerShop::ShoppingCartItem Load (1.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 98 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 98], ["item_type", "Product"], ["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 15ms (ActiveRecord: 2.9ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 28], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 71]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 71 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 71], ["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 71  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"99"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "99"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 99 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 29], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 99], ["item_type", "Product"], ["owner_id", 29], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 29], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 72]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 72 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 72], ["created_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 12:57:31 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 72  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"100"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "100"]] PowerShop::ShoppingCartItem Load (1.1ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 100 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 30], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 100], ["item_type", "Product"], ["owner_id", 30], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 73]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 73 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 73], ["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 73  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"101"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "101"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 101 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 31], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 101], ["item_type", "Product"], ["owner_id", 31], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 31], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 153ms (Views: 0.2ms | ActiveRecord: 4.4ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 74]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 74 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 74], ["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 74  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"102"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "102"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 102 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 102], ["item_type", "Product"], ["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 32], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.8ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 75]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 75 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 75], ["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 75  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"103"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "103"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 103 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 103], ["item_type", "Product"], ["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 33], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 76]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 76 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 76], ["created_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 12:58:24 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 76  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"104"} Product Load (1.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "104"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 104 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 34], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 104], ["item_type", "Product"], ["owner_id", 34], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 2.3ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 34], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 77]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 77 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 77], ["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 77  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"105"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "105"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 105 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 35], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 105], ["item_type", "Product"], ["owner_id", 35], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 78]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 78 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 78], ["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 78  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"106"} Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "106"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 106 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 106], ["item_type", "Product"], ["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 2.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 36], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] Category Load (1.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 79]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 79 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 79], ["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 79  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"107"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "107"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 107 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 107], ["item_type", "Product"], ["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 11ms (ActiveRecord: 1.5ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 37], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] Category Load (0.8ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 80]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 80 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 80], ["created_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 12:58:25 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 80  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"108", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "108"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 108 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 38], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 108], ["item_type", "Product"], ["owner_id", 38], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 38], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 139ms (Views: 138.8ms | ActiveRecord: 0.0ms)  (22.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.4ms) Completed 200 OK in 154ms (Views: 153.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (90.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 81]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 81 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 81], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 81  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"109", "quantity"=>"2"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "109"]] PowerShop::ShoppingCartItem Load (1.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 109 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 109], ["item_type", "Product"], ["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 142ms (ActiveRecord: 4.0ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 43], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 82]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 82 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 82], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 82  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"110"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "110"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 110 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 44], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 110], ["item_type", "Product"], ["owner_id", 44], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 83]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 83 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 83], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 83  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"111"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "111"]] PowerShop::ShoppingCartItem Load (1.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 111 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 45], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 111], ["item_type", "Product"], ["owner_id", 45], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 2.1ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 45], ["owner_type", "PowerShop::ShoppingCart"]]  (0.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 84]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 84 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 84], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 84  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"112"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "112"]] PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 112 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 112], ["item_type", "Product"], ["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 14ms (ActiveRecord: 1.9ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 46], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 85]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 85 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 85], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 85  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"113"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "113"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 113 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 113], ["item_type", "Product"], ["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 47], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 86]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 86 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 86], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 86  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"114"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "114"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 114 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 48], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 114], ["item_type", "Product"], ["owner_id", 48], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 48], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 1.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.8ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 87]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 87 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 87], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 87  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"115"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "115"]] PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 115 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 115], ["item_type", "Product"], ["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 49], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 2.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 88]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 88 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 88], ["created_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:22:40 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 88  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"116"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "116"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 116 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 50], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 116], ["item_type", "Product"], ["owner_id", 50], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 50], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:36 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:36 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 89]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 89 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 89], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 89  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 117 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 54], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 117], ["item_type", "Product"], ["owner_id", 54], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 90]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 90 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 90], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 90  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"118"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "118"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 118 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 55], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 118], ["item_type", "Product"], ["owner_id", 55], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 55], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.2ms | ActiveRecord: 2.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 91]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 91 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 91], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 91  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"119"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "119"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 119 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 56], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 119], ["item_type", "Product"], ["owner_id", 56], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 56], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 92]] SQL (1.1ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 92 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (14.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 92], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 92  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"120"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "120"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 120 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 57], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 120], ["item_type", "Product"], ["owner_id", 57], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 57], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.5ms | ActiveRecord: 2.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 93]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 93 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 93], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 93  (0.5ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"121"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "121"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 121 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 121], ["item_type", "Product"], ["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 58], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 94]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 94 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 94], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 94  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"122"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "122"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 122 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 59], ["owner_type", "PowerShop::ShoppingCart"]]  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 122], ["item_type", "Product"], ["owner_id", 59], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.4ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 95]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 95 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 95], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 95  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"123"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "123"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 123 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 123], ["item_type", "Product"], ["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 60], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 96]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 96 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 96], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 96  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"124"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "124"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 124 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 61], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 124], ["item_type", "Product"], ["owner_id", 61], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms)  (0.5ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 61], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 97]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 97 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 97], ["created_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:30:37 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 97  (0.7ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"125", "quantity"=>"2"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "125"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 125 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 125], ["item_type", "Product"], ["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 62], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 617ms (Views: 616.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:26 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:26 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 98]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 98 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 98], ["created_at", Sun, 31 Aug 2014 14:31:26 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:31:26 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 98  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 126 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 65], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 126], ["item_type", "Product"], ["owner_id", 65], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 137ms (Views: 136.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 99]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 99 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 99], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 99  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"127"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "127"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 127 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 127], ["item_type", "Product"], ["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 68], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 100]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 100 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 100], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 100  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"128"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "128"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 128 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 128], ["item_type", "Product"], ["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 69], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 12ms (Views: 0.1ms | ActiveRecord: 2.2ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 101]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 101 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 101], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 101  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"129"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "129"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 129 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 129], ["item_type", "Product"], ["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 70], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.4ms | ActiveRecord: 2.3ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 102]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 102 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (1.2ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 102], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 102  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"130", "quantity"=>"2"} Product Load (1.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "130"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 130 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 130], ["item_type", "Product"], ["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 12ms (ActiveRecord: 2.4ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 71], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 103]] SQL (1.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 103 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 103], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 103  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"131"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "131"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 131 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 131], ["item_type", "Product"], ["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (1.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 72], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 104]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 104 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 104], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 104  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"132"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "132"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 132 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 132], ["item_type", "Product"], ["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 73], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 105]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 105 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 105], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 105  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"133"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "133"]] PowerShop::ShoppingCartItem Load (1.0ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 133 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 74], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 133], ["item_type", "Product"], ["owner_id", 74], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.7ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 74], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 106]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 106 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 106], ["created_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:31:27 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 106  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"134"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "134"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 134 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 75], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 134], ["item_type", "Product"], ["owner_id", 75], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (22.2ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:57 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 107]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 107 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 107], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 107  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 135 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 76], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 135], ["item_type", "Product"], ["owner_id", 76], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"135"} Completed 500 Internal Server Error in 178ms  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 107ms (Views: 106.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 108]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 108 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 108], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 108  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"136"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "136"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 136 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 136], ["item_type", "Product"], ["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 79], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 15ms (Views: 0.2ms | ActiveRecord: 2.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 109]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 109 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 109], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 109  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"137"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "137"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 137 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 80], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 137], ["item_type", "Product"], ["owner_id", 80], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 80], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 10ms (Views: 0.1ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 110]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 110 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 110], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 110  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"138"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "138"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 138 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 138], ["item_type", "Product"], ["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 81], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 111]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 111 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (2.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 111], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (1.7ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 111  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"139", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "139"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 139 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 139], ["item_type", "Product"], ["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 82], ["owner_type", "PowerShop::ShoppingCart"]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 112]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 112 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 112], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 112  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"140"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "140"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 140 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 140], ["item_type", "Product"], ["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (1.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 83], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 113]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 113 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (1.1ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 113], ["created_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:31:58 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 113  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"141"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "141"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 141 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 84], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 141], ["item_type", "Product"], ["owner_id", 84], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 84], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 114]] SQL (0.8ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 114 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 114], ["created_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 114  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"142"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "142"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 142 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 85], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 142], ["item_type", "Product"], ["owner_id", 85], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 115]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 115 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (2.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 115], ["created_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:31:59 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 115  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"143"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "143"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 143 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 143], ["item_type", "Product"], ["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 86], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (2.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (19.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:18 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:18 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 116]] SQL (1.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 116 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 116], ["created_at", Sun, 31 Aug 2014 14:37:18 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:37:18 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 116  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 144 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 144], ["item_type", "Product"], ["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"144"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "144"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 144 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 87], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.3ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 66 Redirected to Completed 500 Internal Server Error in 7ms  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 137ms (Views: 136.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 117]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 117 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 117], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 117  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"145"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "145"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 145 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 145], ["item_type", "Product"], ["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 90], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 2.6ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 118]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 118 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 118], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 118  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"146"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "146"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 146 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 91], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 146], ["item_type", "Product"], ["owner_id", 91], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 91], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (1.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 119]] SQL (1.2ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 119 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 119], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 119  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"147"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "147"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 147 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 92], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 147], ["item_type", "Product"], ["owner_id", 92], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 92], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 13ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 120]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 120 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (1.4ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 120], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 120  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"148", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "148"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 148 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 93], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 148], ["item_type", "Product"], ["owner_id", 93], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 93], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 121]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 121 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 121], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 121  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"149"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "149"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 149 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 94], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 149], ["item_type", "Product"], ["owner_id", 94], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.9ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 94], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 122]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 122 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (2.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 122], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 122  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"150"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "150"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 150 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 95], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 150], ["item_type", "Product"], ["owner_id", 95], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 95], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 123]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 123 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 123], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 123  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"151"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "151"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 151 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 96], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 151], ["item_type", "Product"], ["owner_id", 96], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.5ms)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 124]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 124 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (2.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 124], ["created_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:37:19 UTC +00:00]] SQL (0.5ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 124  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"152"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "152"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 152 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 97], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 152], ["item_type", "Product"], ["owner_id", 97], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.3ms)  (1.0ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 97], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.1ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (20.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 125]] SQL (0.9ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 125 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 125], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 125  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (1.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 153 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 98], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 153], ["item_type", "Product"], ["owner_id", 98], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"153"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "153"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 153 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 98], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.3ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 75 Redirected to /cart Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 126]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 126 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 126], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (1.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 126  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (1.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 154 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 99], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 154], ["item_type", "Product"], ["owner_id", 99], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"154"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "154"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 154 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 99], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.3ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 76 Redirected to /cart Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 136ms (Views: 135.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.9ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 127]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 127 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 127], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 127  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"155"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "155"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 155 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 155], ["item_type", "Product"], ["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 102], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.9ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 128]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 128 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 128], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 128  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"156"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "156"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 156 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 156], ["item_type", "Product"], ["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 103], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.6ms | ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 129]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 129 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 129], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 129  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"157"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "157"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 157 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 157], ["item_type", "Product"], ["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 104], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.2ms | ActiveRecord: 1.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 130]] SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 130 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 130], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 130  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"158", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "158"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 158 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 158], ["item_type", "Product"], ["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.6ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 105], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 131]] SQL (1.0ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 131 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 131], ["created_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:38:20 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 131  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"159"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "159"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 159 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 159], ["item_type", "Product"], ["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 106], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.6ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.3ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 132]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 132 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 132], ["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 132  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"160"} Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "160"]] PowerShop::ShoppingCartItem Load (1.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 160 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 107], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 160], ["item_type", "Product"], ["owner_id", 107], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 13ms (ActiveRecord: 2.7ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 107], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 133]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 133 ORDER BY "categories"."lft")  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 133], ["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 133  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"161"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "161"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 161 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 161], ["item_type", "Product"], ["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.1ms)  (0.8ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 108], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 134]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 134 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 134], ["created_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00], ["name", "Test product-10"], ["price", 500.0], ["slug", "test-product-10"], ["updated_at", Sun, 31 Aug 2014 14:38:21 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 134  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"162"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "162"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 162 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 109], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 162], ["item_type", "Product"], ["owner_id", 109], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Rendered /vagrant/power_shop/app/views/power_shop/cart/show.html.erb within layouts/application (0.3ms) Completed 200 OK in 143ms (Views: 142.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (1.2ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.6ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (60.1ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 135]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 135 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (1.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 135], ["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 135  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 163 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 163], ["item_type", "Product"], ["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"163"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "163"]] PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 163 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 112], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.3ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 85 Redirected to /cart Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 136]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 136 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (1.0ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 136], ["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 136  (0.4ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 164 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 164], ["item_type", "Product"], ["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"164"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "164"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 164 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 113], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.2ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 86 Redirected to /cart Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.7ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 137]] SQL (0.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 137 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 137], ["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 137  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"165", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "165"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 165 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 165], ["item_type", "Product"], ["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 10ms (ActiveRecord: 1.7ms) PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 114], ["owner_type", "PowerShop::ShoppingCart"]]  (0.6ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.3ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 138]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 138 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 138], ["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 138  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"166"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "166"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 166 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 166], ["item_type", "Product"], ["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 115], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 139]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 139 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 139], ["created_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:38:49 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 139  (0.3ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"167"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "167"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 167 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 116], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 167], ["item_type", "Product"], ["owner_id", 116], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 116], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 2.1ms)  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 140]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 140 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 140], ["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] SQL (1.6ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 140  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"168"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "168"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 168 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 168], ["item_type", "Product"], ["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 117], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.1ms | ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 141]] SQL (1.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 141 ORDER BY "categories"."lft")  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 141], ["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] SQL (1.1ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 141  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"169"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "169"]] PowerShop::ShoppingCartItem Load (1.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 169 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 169], ["item_type", "Product"], ["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 2.1ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 118], ["owner_type", "PowerShop::ShoppingCart"]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 142]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 142 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 142], ["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] SQL (0.9ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 142  (0.8ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"170"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "170"]] PowerShop::ShoppingCartItem Load (0.8ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 170 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 170], ["item_type", "Product"], ["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 119], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (1.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 143]] SQL (0.6ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 143 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.5ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 143], ["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 143  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"171"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "171"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 171 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 171], ["item_type", "Product"], ["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.5ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 120], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 144]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 144 ORDER BY "categories"."lft")  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.8ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 144], ["created_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00], ["name", "Test product-10"], ["price", 500.0], ["slug", "test-product-10"], ["updated_at", Sun, 31 Aug 2014 14:38:50 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 144  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"172"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "172"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 172 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 121], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 172], ["item_type", "Product"], ["owner_id", 121], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 8ms (ActiveRecord: 1.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (1.0ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (1.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (18.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 145]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 145 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.9ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-1' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 145], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-1"], ["price", 500.0], ["slug", "test-product-1"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 145  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"173"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "173"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 173 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 122], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 173], ["item_type", "Product"], ["owner_id", 122], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 116ms (ActiveRecord: 3.6ms)  (0.4ms) SELECT COUNT(*) FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 122], ["owner_type", "PowerShop::ShoppingCart"]]  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.7ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 146]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 146 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-2' LIMIT 1 SQL (0.9ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 146], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-2"], ["price", 500.0], ["slug", "test-product-2"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (1.0ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 146  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"174"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "174"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 174 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 123], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 174], ["item_type", "Product"], ["owner_id", 123], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 7ms (ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 147]] SQL (1.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 147 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-3' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 147], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-3"], ["price", 500.0], ["slug", "test-product-3"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 147  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"175"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "175"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 175 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 175], ["item_type", "Product"], ["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.8ms) PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 124], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.7ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 148]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 148 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.5ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-4' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 148], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-4"], ["price", 500.0], ["slug", "test-product-4"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.4ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 148  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"176"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "176"]] PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 176 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 176], ["item_type", "Product"], ["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 125], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 149]] SQL (1.4ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 149 ORDER BY "categories"."lft")  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-5' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 149], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-5"], ["price", 500.0], ["slug", "test-product-5"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 149  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as HTML Parameters: {"product_id"=>"177", "quantity"=>"2"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "177"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 177 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 177], ["item_type", "Product"], ["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to / Completed 302 Found in 9ms (ActiveRecord: 1.6ms) PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 126], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 150]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 150 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.6ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-6' LIMIT 1 SQL (1.3ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 150], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-6"], ["price", 500.0], ["slug", "test-product-6"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (1.2ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 150  (0.4ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"178"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "178"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 178 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 178], ["item_type", "Product"], ["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 127], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.0ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.5ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (1.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.6ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 151]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 151 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-7' LIMIT 1 SQL (0.7ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 151], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-7"], ["price", 500.0], ["slug", "test-product-7"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 151  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"179"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "179"]] PowerShop::ShoppingCartItem Load (1.2ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 179 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 179], ["item_type", "Product"], ["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.4ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 128], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 14ms (Views: 0.2ms | ActiveRecord: 2.5ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 152]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 152 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.4ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-8' LIMIT 1 SQL (1.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 152], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-8"], ["price", 500.0], ["slug", "test-product-8"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 152  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#add_product as JS Parameters: {"product_id"=>"180"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "180"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 180 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 129], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 180], ["item_type", "Product"], ["owner_id", 129], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 [["owner_id", 129], ["owner_type", "PowerShop::ShoppingCart"]] Completed 200 OK in 9ms (Views: 0.2ms | ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 138ms (Views: 137.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#show as HTML Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Category Exists (0.4ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.5ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 153]] SQL (0.7ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 153 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.7ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-9' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 153], ["created_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00], ["name", "Test product-9"], ["price", 500.0], ["slug", "test-product-9"], ["updated_at", Sun, 31 Aug 2014 14:39:56 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 153  (0.1ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.7ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 181 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 181], ["item_type", "Product"], ["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"181"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "181"]] PowerShop::ShoppingCartItem Load (0.5ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 181 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.3ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 103 Redirected to /cart Completed 302 Found in 6ms (ActiveRecord: 1.1ms) ShoppingCart Load (0.4ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" = $1 LIMIT 1 [["id", 132]] PowerShop::ShoppingCartItem Exists (0.6ms) SELECT 1 AS one FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 LIMIT 1 [["owner_id", 132], ["owner_type", "PowerShop::ShoppingCart"]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_carts" DEFAULT VALUES RETURNING "id"  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Category Exists (0.5ms) SELECT 1 AS one FROM "categories" WHERE ("categories"."id" IS NOT NULL) AND "categories"."slug" = 'test-category' LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT 1 SQL (0.4ms) INSERT INTO "categories" ("created_at", "lft", "name", "rgt", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Sun, 31 Aug 2014 14:39:57 UTC +00:00], ["lft", 1], ["name", "Test category"], ["rgt", 2], ["slug", "test-category"], ["updated_at", Sun, 31 Aug 2014 14:39:57 UTC +00:00]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 154]] SQL (0.5ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 154 ORDER BY "categories"."lft")  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Product Exists (0.8ms) SELECT 1 AS one FROM "products" WHERE ("products"."id" IS NOT NULL) AND "products"."slug" = 'test-product-10' LIMIT 1 SQL (0.6ms) INSERT INTO "products" ("category_id", "created_at", "name", "price", "slug", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["category_id", 154], ["created_at", Sun, 31 Aug 2014 14:39:57 UTC +00:00], ["name", "Test product-10"], ["price", 500.0], ["slug", "test-product-10"], ["updated_at", Sun, 31 Aug 2014 14:39:57 UTC +00:00]] SQL (0.3ms) UPDATE "categories" SET "products_count" = COALESCE("products_count", 0) + 1 WHERE "categories"."id" = 154  (0.2ms) RELEASE SAVEPOINT active_record_1 PowerShop::ShoppingCartItem Load (0.6ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 182 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "shopping_cart_items" ("item_id", "item_type", "owner_id", "owner_type", "price", "quantity") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["item_id", 182], ["item_type", "Product"], ["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"], ["price", 500.0], ["quantity", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by PowerShop::CartController#delete_product as HTML Parameters: {"product_id"=>"182"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", "182"]] PowerShop::ShoppingCartItem Load (0.3ms) SELECT "shopping_cart_items".* FROM "shopping_cart_items" WHERE "shopping_cart_items"."owner_id" = $1 AND "shopping_cart_items"."owner_type" = $2 AND "shopping_cart_items"."item_type" = 'Product' AND "shopping_cart_items"."item_id" = 182 ORDER BY "shopping_cart_items"."id" ASC LIMIT 1 [["owner_id", 133], ["owner_type", "PowerShop::ShoppingCart"]] SQL (0.2ms) DELETE FROM "shopping_cart_items" WHERE "shopping_cart_items"."id" = 104 Redirected to /cart Completed 302 Found in 5ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK